1.1 --- a/imiptools/handlers/resource.py Wed Sep 02 17:52:52 2015 +0200
1.2 +++ b/imiptools/handlers/resource.py Wed Sep 02 17:53:31 2015 +0200
1.3 @@ -51,12 +51,33 @@
1.4
1.5 handle_for_attendee()
1.6
1.7 - def _schedule_for_attendee(self):
1.8 + def _add_for_attendee(self):
1.9
1.10 """
1.11 - Attempt to schedule the current object for the current user.
1.12 + Attempt to add a recurrence to an existing object for the current user.
1.13 + This does not request a response concerning participation, apparently.
1.14 """
1.15
1.16 + # Ignore unknown objects.
1.17 + # NOTE: We could issue a REFRESH to get such objects.
1.18 +
1.19 + if not self.get_stored_object_version():
1.20 + return
1.21 +
1.22 + # Record the event as a recurrence of the parent object.
1.23 +
1.24 + self.update_recurrenceid()
1.25 + event = self.obj.to_node()
1.26 + self.store.set_event(self.user, self.uid, self.recurrenceid, event)
1.27 +
1.28 + # Update free/busy information.
1.29 +
1.30 + self.update_event_in_freebusy(for_organiser=False)
1.31 +
1.32 + def _schedule_for_attendee(self):
1.33 +
1.34 + "Attempt to schedule the current object for the current user."
1.35 +
1.36 method = "REPLY"
1.37
1.38 # Check any constraints on the request.
1.39 @@ -124,7 +145,7 @@
1.40
1.41 # Update free/busy information.
1.42
1.43 - self.update_event_in_freebusy(from_organiser=False)
1.44 + self.update_event_in_freebusy(for_organiser=False)
1.45 else:
1.46 attendee_attr = self.obj.get_value_map("ATTENDEE")[self.user]
1.47
1.48 @@ -156,7 +177,10 @@
1.49 "An event handler."
1.50
1.51 def add(self):
1.52 - pass
1.53 +
1.54 + "Add a new occurrence to an existing event."
1.55 +
1.56 + self._record_and_respond(self._add_for_attendee)
1.57
1.58 def cancel(self):
1.59
1.60 @@ -180,6 +204,12 @@
1.61 pass
1.62
1.63 def publish(self):
1.64 +
1.65 + """
1.66 + Resources only consider events sent as requests, not generally published
1.67 + events.
1.68 + """
1.69 +
1.70 pass
1.71
1.72 def refresh(self):
1.73 @@ -189,6 +219,8 @@
1.74 do not act as organisers themselves.
1.75 """
1.76
1.77 + pass
1.78 +
1.79 def reply(self):
1.80
1.81 "Since this handler does not send requests, it will not handle replies."
1.82 @@ -211,6 +243,9 @@
1.83 "A free/busy handler."
1.84
1.85 def publish(self):
1.86 +
1.87 + "Resources ignore generally published free/busy information."
1.88 +
1.89 pass
1.90
1.91 def reply(self):