Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2011-03-29 21:26:29 (GMT)
committer Simon Schampijer <simon@schampijer.de>2011-03-31 16:09:55 (GMT)
commit95b4eeec758ffa729d0dbb219b21d428115fcc74 (patch)
tree7330d76689cb50ee295aa1646bf6b28d5b207456
parentd329d8ccdb67d967c5951952c6fd245cbcae6d56 (diff)
Store all the buddies that have been joined in the activity metadata OLPC #10578
Before only the buddies that were present when closing the activity were logged in the Journal. This patch does add another dictionary '_joined_buddies' to keep track of the users that did join. The '_buddies' dictionary keeps on tracking the users currently in the activity. Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Sascha Silbe <silbe@activitycentral.com>
-rw-r--r--src/sugar/presence/activity.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sugar/presence/activity.py b/src/sugar/presence/activity.py
index 8057841..b616510 100644
--- a/src/sugar/presence/activity.py
+++ b/src/sugar/presence/activity.py
@@ -109,6 +109,7 @@ class Activity(gobject.GObject):
self._channel_self_handle = None
self._text_channel_group_flags = 0
self._buddies = {}
+ self._joined_buddies = {}
self._get_properties_call = None
if not self.room_handle is None:
@@ -231,7 +232,7 @@ class Activity(gobject.GObject):
returns list of presence Buddy objects that we can successfully
create from the buddy object paths that PS has for this activity.
"""
- return self._buddies.values()
+ return self._joined_buddies.values()
def get_buddy_by_handle(self, handle):
"""Retrieve the Buddy object given a telepathy handle.
@@ -321,6 +322,7 @@ class Activity(gobject.GObject):
_logger.debug('__add_initial_buddies %r', contact_ids)
for contact_id in contact_ids:
self._buddies[contact_id] = self._get_buddy(contact_id)
+ self._joined_buddies[contact_id] = self._get_buddy(contact_id)
# Once we have the initial members, we can finish the join process
self._joined = True
self.emit('joined', True, None)
@@ -347,6 +349,8 @@ class Activity(gobject.GObject):
buddy = self._get_buddy(contact_id)
self.emit('buddy-joined', buddy)
self._buddies[contact_id] = buddy
+ if contact_id not in self._joined_buddies:
+ self._joined_buddies[contact_id] = buddy
def _remove_buddies(self, contact_ids):
for contact_id in contact_ids: