summaryrefslogtreecommitdiffstats
path: root/wallace
diff options
context:
space:
mode:
Diffstat (limited to 'wallace')
-rw-r--r--wallace/module_invitationpolicy.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/wallace/module_invitationpolicy.py b/wallace/module_invitationpolicy.py
index 4ac7eef..993cd5e 100644
--- a/wallace/module_invitationpolicy.py
+++ b/wallace/module_invitationpolicy.py
@@ -18,6 +18,7 @@
#
import datetime
+import pytz
import os
import tempfile
import time
@@ -656,6 +657,14 @@ def process_itip_cancel(itip_event, policy, recipient_email, sender_email, recei
))
return MESSAGE_FORWARD
+ # on this-and-future cancel requests, set the recurrence until date on the master event
+ if itip_event['recurrence-id'] and master and itip_event['xml'].get_thisandfuture():
+ rrule = master.get_recurrence()
+ rrule.set_count(0)
+ rrule.set_until(existing.get_start().astimezone(pytz.utc) + datetime.timedelta(days=-1))
+ master.set_recurrence(rrule)
+ existing.set_recurrence_id(existing.get_recurrence_id(), True)
+
existing.set_status('CANCELLED')
existing.set_transparency(True)
if update_object(existing, receiving_user, master):