1.1 --- a/imip_manager.py Sat Mar 07 00:13:41 2015 +0100
1.2 +++ b/imip_manager.py Sun Mar 08 01:35:43 2015 +0100
1.3 @@ -228,7 +228,9 @@
1.4 update_freebusy(freebusy,
1.5 self.obj.get_periods_for_freebusy(self.get_tzid(), self.get_window_end()),
1.6 self.obj.get_value("TRANSP") or "OPAQUE",
1.7 - self.uid, self.recurrenceid)
1.8 + self.uid, self.recurrenceid,
1.9 + self.obj.get_value("SUMMARY"),
1.10 + organiser)
1.11
1.12 user_attr = self.messenger and self.messenger.sender != get_address(self.user) and \
1.13 {"SENT-BY" : get_uri(self.messenger.sender)} or {}
1.14 @@ -374,15 +376,23 @@
1.15 obj = self._get_object(uid, recurrenceid)
1.16 if obj:
1.17 periods = obj.get_periods_for_freebusy(self.get_tzid(), self.get_window_end())
1.18 -
1.19 - # Subtract any recurrences from the free/busy details of a parent
1.20 - # object.
1.21 -
1.22 recurrenceids = self._get_recurrences(uid)
1.23
1.24 + # Convert the periods to more substantial free/busy items.
1.25 +
1.26 for start, end in periods:
1.27 +
1.28 + # Subtract any recurrences from the free/busy details of a
1.29 + # parent object.
1.30 +
1.31 if recurrenceid or start not in recurrenceids:
1.32 - summary.append((start, end, uid, obj.get_value("TRANSP"), recurrenceid))
1.33 + summary.append((
1.34 + start, end, uid,
1.35 + obj.get_value("TRANSP"),
1.36 + recurrenceid,
1.37 + obj.get_value("SUMMARY"),
1.38 + obj.get_value("ORGANIZER")
1.39 + ))
1.40 return summary
1.41
1.42 # Preference methods.
1.43 @@ -430,7 +440,9 @@
1.44 update_freebusy(freebusy,
1.45 obj.get_periods_for_freebusy(self.get_tzid(), self.get_window_end()),
1.46 is_only_organiser and "ORG" or obj.get_value("TRANSP"),
1.47 - uid, recurrenceid)
1.48 + uid, recurrenceid,
1.49 + obj.get_value("SUMMARY"),
1.50 + obj.get_value("ORGANIZER"))
1.51
1.52 # Subtract any recurrences from the free/busy details of a parent
1.53 # object.
1.54 @@ -709,7 +721,7 @@
1.55 elif save:
1.56 to_cancel = self.update_attendees(obj, added, removed)
1.57 self.store.set_event(self.user, uid, recurrenceid, node=obj.to_node())
1.58 - self.update_freebusy(uid, recurrenceid, obj=obj)
1.59 + self.update_freebusy(uid, recurrenceid, obj)
1.60 self.remove_request(uid, recurrenceid)
1.61
1.62 # Remove the request and the object.
1.63 @@ -1702,7 +1714,7 @@
1.64 page.td.close()
1.65 empty = 0
1.66
1.67 - start, end, uid, recurrenceid, key = get_freebusy_details(t)
1.68 + start, end, uid, recurrenceid, summary, organiser, key = get_freebusy_details(t)
1.69 span = spans[key]
1.70
1.71 # Produce a table cell only at the start of the period
1.72 @@ -1710,11 +1722,9 @@
1.73
1.74 if point == start or continuation:
1.75
1.76 - obj = self._get_object(uid, recurrenceid)
1.77 -
1.78 has_continued = continuation and point != start
1.79 will_continue = not ends_on_same_day(point, end, tzid)
1.80 - is_organiser = obj and get_uri(obj.get_value("ORGANIZER")) == self.user
1.81 + is_organiser = organiser == self.user
1.82
1.83 css = " ".join(
1.84 ["event"] +
1.85 @@ -1732,18 +1742,13 @@
1.86 else:
1.87 page.td(class_=css, rowspan=span)
1.88
1.89 - if not obj:
1.90 - page.span("(Participant is busy)")
1.91 + # Only link to events if they are not being
1.92 + # updated by requests.
1.93 +
1.94 + if not summary or (uid, recurrenceid) in self._get_requests() and group_type != "request":
1.95 + page.span(summary or "(Participant is busy)")
1.96 else:
1.97 - summary = obj.get_value("SUMMARY")
1.98 -
1.99 - # Only link to events if they are not being
1.100 - # updated by requests.
1.101 -
1.102 - if (uid, recurrenceid) in self._get_requests() and group_type != "request":
1.103 - page.span(summary)
1.104 - else:
1.105 - page.a(summary, href=self.link_to(uid, recurrenceid))
1.106 + page.a(summary, href=self.link_to(uid, recurrenceid))
1.107
1.108 page.td.close()
1.109 else: