1.1 --- a/imip_agent.py Thu Sep 25 23:21:21 2014 +0200
1.2 +++ b/imip_agent.py Wed Oct 01 00:02:17 2014 +0200
1.3 @@ -211,11 +211,7 @@
1.4 encoding = "utf-8"
1.5 out = StringIO()
1.6 try:
1.7 - calendar[:0] = [
1.8 - ("METHOD", {}, method),
1.9 - ("VERSION", {}, "2.0")
1.10 - ]
1.11 - imip_store.to_stream(out, ("VCALENDAR", {}, calendar), encoding)
1.12 + imip_store.to_stream(out, imip_store.make_calendar(calendar, method), encoding)
1.13 part = MIMEText(out.getvalue(), "calendar", encoding)
1.14 part.set_param("method", method)
1.15 return part
1.16 @@ -311,6 +307,11 @@
1.17
1.18 self.store = imip_store.FileStore()
1.19
1.20 + try:
1.21 + self.publisher = imip_store.FilePublisher()
1.22 + except OSError:
1.23 + self.publisher = None
1.24 +
1.25 def get_items(self, name, all=True):
1.26 return get_items(self.details, name, all)
1.27
1.28 @@ -450,9 +451,12 @@
1.29 if not conflict:
1.30 insert_period(freebusy, (dtstart, dtend, self.uid))
1.31
1.32 - if self.get_value("TRANSP") in (None, "TRANSPARENT"):
1.33 + if self.get_value("TRANSP") in (None, "OPAQUE"):
1.34 self.store.set_freebusy(attendee, freebusy)
1.35
1.36 + if self.publisher:
1.37 + self.publisher.set_freebusy(attendee, freebusy)
1.38 +
1.39 self.store.set_event(attendee, self.uid, to_node(
1.40 {"VEVENT" : [(self.details, {})]}
1.41 ))