summaryrefslogtreecommitdiffstats
path: root/wallace
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-20 10:44:22 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-20 10:44:22 +0100
commit05f1d4e5787acde1835337ca5dff4b86470fe53e (patch)
treee4b8f0b37b6211cb4aefedb987bf4c9295859305 /wallace
parente43e509c773c7f69ab4c479c708d20aae0cf063d (diff)
downloadpykolab-05f1d4e5787acde1835337ca5dff4b86470fe53e.tar.gz
Support iTip CANCEL requests with THISANDFUTRE range
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):