From 61d236e5d4cd5c833282069523eb038795c420c5 Mon Sep 17 00:00:00 2001 From: Morgan Collett Date: Fri, 12 Oct 2007 11:23:18 +0100 Subject: [PATCH] Fix _buddy_handle_joined_cb, make _buddy_handle_left_cb more robust --- sugar/presence/activity.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sugar/presence/activity.py b/sugar/presence/activity.py index 90ec9f53..68d5d4df 100644 --- a/sugar/presence/activity.py +++ b/sugar/presence/activity.py @@ -184,7 +184,7 @@ class Activity(gobject.GObject): def _buddy_handle_joined_cb(self, object_path, handle): gobject.idle_add(self._emit_buddy_joined_signal, object_path) - self._handle_to_buddy[handle] = self._ps_new_object(handle) + self._handle_to_buddy[handle] = self._ps_new_object(object_path) def _emit_buddy_left_signal(self, object_path): """Generate buddy-left GObject signal with presence Buddy object @@ -196,8 +196,7 @@ class Activity(gobject.GObject): def _buddy_handle_left_cb(self, object_path, handle): gobject.idle_add(self._emit_buddy_left_signal, object_path) - # XXX This may still lose the mapping we need: - del self._handle_to_buddy[handle] + buddy = self._handle_to_buddy.pop(handle, None) def _emit_new_channel_signal(self, object_path): """Generate new-channel GObject signal with channel object path