From 21aa37cc24edf3b4f4e69e263f049c7298bf7bf0 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 19 Oct 2006 13:28:59 +0200 Subject: [PATCH] Do not assume when curactivity change we already know about that activity. --- shell/model/MeshModel.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shell/model/MeshModel.py b/shell/model/MeshModel.py index 374e5fa1..f65b9807 100644 --- a/shell/model/MeshModel.py +++ b/shell/model/MeshModel.py @@ -86,7 +86,7 @@ class MeshModel(gobject.GObject): if cur_activity == None: self.emit('buddy-moved', buddy_model, None) - else: + elif self._activities.has_key(cur_activity.get_id()): activity_model = self._activities[cur_activity.get_id()] self.emit('buddy-moved', buddy_model, activity_model) @@ -121,6 +121,12 @@ class MeshModel(gobject.GObject): self._activities[model.get_id()] = model self.emit('activity-added', model) + for buddy in self._pservice.get_buddies(): + cur_activity = buddy.get_current_activity() + if cur_activity == activity: + buddy_model = self._buddies[buddy.get_name()] + self.emit('buddy-moved', buddy, model) + def _activity_disappeared_cb(self, pservice, activity): if self._activities.has_key(activity.get_id()): activity_model = self._activities[activity.get_id()]