1.1 --- a/imiptools/data.py Mon Oct 16 22:10:22 2017 +0200
1.2 +++ b/imiptools/data.py Mon Oct 16 23:37:59 2017 +0200
1.3 @@ -1319,7 +1319,8 @@
1.4 """
1.5 Return a mapping from actual senders to the identities for which they
1.6 have provided data, extracting this information from the given
1.7 - 'mapping'.
1.8 + 'mapping'. The SENT-BY attribute provides sender information in preference
1.9 + to the property values given as the mapping keys.
1.10 """
1.11
1.12 senders = {}
1.13 @@ -1348,4 +1349,24 @@
1.14
1.15 return to_timezone(start or datetime.now(), tzid) + timedelta(days)
1.16
1.17 +def update_attendees_with_delegates(stored_attendees, attendees):
1.18 +
1.19 + """
1.20 + Update the 'stored_attendees' mapping with delegate information from the
1.21 + given 'attendees' mapping.
1.22 + """
1.23 +
1.24 + # Check for delegated attendees.
1.25 +
1.26 + for attendee, attendee_attr in attendees.items():
1.27 +
1.28 + # Identify delegates and check the delegation using the updated
1.29 + # attendee information.
1.30 +
1.31 + if not stored_attendees.has_key(attendee) and \
1.32 + attendee_attr.has_key("DELEGATED-FROM") and \
1.33 + check_delegation(stored_attendees, attendee, attendee_attr):
1.34 +
1.35 + stored_attendees[attendee] = attendee_attr
1.36 +
1.37 # vim: tabstop=4 expandtab shiftwidth=4