1.1 --- a/imip_manager.py Tue Mar 24 23:33:15 2015 +0100
1.2 +++ b/imip_manager.py Wed Mar 25 16:27:28 2015 +0100
1.3 @@ -157,7 +157,8 @@
1.4
1.5 for attendee, attendee_attr in attendees:
1.6 if attendee in removed:
1.7 - to_cancel.append((attendee, attendee_attr))
1.8 + if attendee_attr.get("PARTSTAT") in ("ACCEPTED", "TENTATIVE"):
1.9 + to_cancel.append((attendee, attendee_attr))
1.10 else:
1.11 remaining.append((attendee, attendee_attr))
1.12
2.1 --- a/imiptools/__init__.py Tue Mar 24 23:33:15 2015 +0100
2.2 +++ b/imiptools/__init__.py Wed Mar 25 16:27:28 2015 +0100
2.3 @@ -65,12 +65,21 @@
2.4
2.5 msg = message_from_file(f)
2.6 senders = get_addresses(msg.get_all("Reply-To") or msg.get_all("From") or [])
2.7 - original_recipients = original_recipients or get_addresses(get_all_values(msg, "To") or [])
2.8
2.9 # Handle messages with iTIP parts.
2.10 + # Typically, the details of recipients are of interest in handling
2.11 + # messages.
2.12
2.13 - for recipient in original_recipients:
2.14 - self.process_for_recipient(msg, recipient, senders, outgoing_only)
2.15 + if not outgoing_only:
2.16 + original_recipients = original_recipients or get_addresses(get_all_values(msg, "To") or [])
2.17 + for recipient in original_recipients:
2.18 + self.process_for_recipient(msg, recipient, senders, outgoing_only)
2.19 +
2.20 + # However, outgoing messages do not usually presume anything about the
2.21 + # eventual recipients.
2.22 +
2.23 + else:
2.24 + self.process_for_recipient(msg, None, senders, outgoing_only)
2.25
2.26 def process_for_recipient(self, msg, recipient, senders, outgoing_only):
2.27