1.1 --- a/imiptools/data.py Sun Oct 18 13:56:13 2015 +0200
1.2 +++ b/imiptools/data.py Sun Oct 18 17:32:02 2015 +0200
1.3 @@ -424,6 +424,39 @@
1.4
1.5 return main_changed or old_values != set(self.get_date_values("RDATE") or [])
1.6
1.7 + def set_rule(self, rule):
1.8 +
1.9 + """
1.10 + Set the given 'rule' in this object, replacing the previous RRULE
1.11 + property, returning whether the object has changed. The provided 'rule'
1.12 + must be an item.
1.13 + """
1.14 +
1.15 + if not rule:
1.16 + return False
1.17 +
1.18 + old_rrule = self.get_item("RRULE")
1.19 + self["RRULE"] = [rule]
1.20 + return old_rrule != rule
1.21 +
1.22 + def set_exceptions(self, exceptions):
1.23 +
1.24 + """
1.25 + Set the given 'exceptions' in this object, replacing the previous EXDATE
1.26 + properties, returning whether the object has changed. The provided
1.27 + 'exceptions' must be a collection of items.
1.28 + """
1.29 +
1.30 + old_exdates = set(self.get_date_values("EXDATE") or [])
1.31 + if exceptions:
1.32 + self["EXDATE"] = exceptions
1.33 + return old_exdates != set(self.get_date_values("EXDATE") or [])
1.34 + elif old_exdates:
1.35 + del self["EXDATE"]
1.36 + return True
1.37 + else:
1.38 + return False
1.39 +
1.40 def update_dtstamp(self):
1.41
1.42 "Update the DTSTAMP in the object."
2.1 --- a/imipweb/event.py Sun Oct 18 13:56:13 2015 +0200
2.2 +++ b/imipweb/event.py Sun Oct 18 17:32:02 2015 +0200
2.3 @@ -818,6 +818,7 @@
2.4
2.5 # Set the periods in the object, first obtaining removed and
2.6 # modified period information.
2.7 + # NOTE: Currently, rules are not updated.
2.8
2.9 to_unschedule, to_exclude = self.get_removed_periods(periods)
2.10 periods = set(periods)
2.11 @@ -905,6 +906,8 @@
2.12 attendee_uri = get_uri(args.get("counter", [])[i])
2.13 obj = self.get_stored_object(self.uid, self.recurrenceid, "counters", attendee_uri)
2.14 self.obj.set_periods(self.get_periods(obj))
2.15 + self.obj.set_rule(obj.get_item("RRULE"))
2.16 + self.obj.set_exceptions(obj.get_items("EXDATE"))
2.17 break
2.18
2.19 # Remove counter-proposals and issue a new invitation.