imip-agent

Change of imiptools/handlers/person_outgoing.py

291:e28bfb8b0ca1
imiptools/handlers/person_outgoing.py
     1.1 --- a/imiptools/handlers/person_outgoing.py	Sun Feb 08 01:26:33 2015 +0100
     1.2 +++ b/imiptools/handlers/person_outgoing.py	Sun Feb 08 18:39:03 2015 +0100
     1.3 @@ -22,6 +22,8 @@
     1.4  
     1.5  from imiptools.content import Handler
     1.6  from imiptools.data import uri_item
     1.7 +from imiptools.dates import get_default_timezone
     1.8 +from imiptools.profile import Preferences
     1.9  
    1.10  class PersonHandler(Handler):
    1.11  
    1.12 @@ -69,10 +71,15 @@
    1.13  
    1.14          if update_freebusy:
    1.15  
    1.16 +            # Interpretation of periods can depend on the time zone.
    1.17 +
    1.18 +            preferences = Preferences(identity)
    1.19 +            tzid = preferences.get("TZID") or get_default_timezone()
    1.20 +
    1.21              # If newer than any old version, discard old details from the
    1.22              # free/busy record and check for suitability.
    1.23  
    1.24 -            periods = self.obj.get_periods()
    1.25 +            periods = self.obj.get_periods_for_freebusy(tzid)
    1.26              freebusy = self.store.get_freebusy(identity)
    1.27  
    1.28              if attr.get("PARTSTAT") != "DECLINED":