imip-agent

Changeset

684:fad0c1540cf8
2015-09-04 Paul Boddie raw files shortlog changelog graph Introduced tentative support for handling outgoing ADD method messages.
imiptools/handlers/person_outgoing.py (file)
     1.1 --- a/imiptools/handlers/person_outgoing.py	Fri Sep 04 00:10:55 2015 +0200
     1.2 +++ b/imiptools/handlers/person_outgoing.py	Fri Sep 04 00:26:36 2015 +0200
     1.3 @@ -38,6 +38,39 @@
     1.4  
     1.5          self.user, attr = uri_item(self.obj.get_item(from_organiser and "ORGANIZER" or "ATTENDEE"))
     1.6  
     1.7 +    def _add(self):
     1.8 +
     1.9 +        "Add a recurrence for the current object."
    1.10 +
    1.11 +        self.set_identity()
    1.12 +
    1.13 +        # Obtain valid organiser and attendee details.
    1.14 +
    1.15 +        oa = self.require_organiser_and_attendees()
    1.16 +        if not oa:
    1.17 +            return False
    1.18 +
    1.19 +        (organiser, organiser_attr), attendees = oa
    1.20 +
    1.21 +        # Ignore unknown objects.
    1.22 +
    1.23 +        if not self.get_stored_object_version():
    1.24 +            return
    1.25 +
    1.26 +        # Record the event as a recurrence of the parent object.
    1.27 +
    1.28 +        self.update_recurrenceid()
    1.29 +
    1.30 +        # Update free/busy information.
    1.31 +
    1.32 +        self.update_event_in_freebusy()
    1.33 +
    1.34 +        # Set the additional occurrence.
    1.35 +
    1.36 +        self.store.set_event(self.user, self.uid, self.recurrenceid, self.obj.to_node())
    1.37 +
    1.38 +        return True
    1.39 +
    1.40      def _record(self, from_organiser=True):
    1.41  
    1.42          """
    1.43 @@ -153,7 +186,7 @@
    1.44      "An event handler."
    1.45  
    1.46      def add(self):
    1.47 -        pass
    1.48 +        self._add()
    1.49  
    1.50      def cancel(self):
    1.51          self._remove(True)