imip-agent

Change of imiptools/handlers/person_outgoing.py

97:9dedbc0dddbd
imiptools/handlers/person_outgoing.py
     1.1 --- a/imiptools/handlers/person_outgoing.py	Thu Oct 30 19:08:19 2014 +0100
     1.2 +++ b/imiptools/handlers/person_outgoing.py	Thu Oct 30 19:35:40 2014 +0100
     1.3 @@ -15,6 +15,11 @@
     1.4      def _record(self, objtype, from_organiser=True, update_freebusy=False):
     1.5          identity = self.get_value(from_organiser and "ORGANIZER" or "ATTENDEE")
     1.6  
     1.7 +        # Check for event using UID.
     1.8 +
     1.9 +        if not self.have_new_object(identity, objtype):
    1.10 +            return
    1.11 +
    1.12          # Store the object.
    1.13  
    1.14          self.store.set_event(identity, self.uid, to_node(
    1.15 @@ -24,9 +29,15 @@
    1.16          # Update free/busy information.
    1.17  
    1.18          if update_freebusy:
    1.19 +
    1.20 +            # If newer than any old version, discard old details from the
    1.21 +            # free/busy record and check for suitability.
    1.22 +
    1.23              periods = self.get_periods()
    1.24              freebusy = self.store.get_freebusy(identity) or []
    1.25 +
    1.26              self.update_freebusy(freebusy, identity, periods)
    1.27 +
    1.28              if self.publisher:
    1.29                  self.publisher.set_freebusy(identity, freebusy)
    1.30