From f2b2b8c6baaf9cb1159c2f962e3c609b927bd550 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 22 Sep 2006 21:36:52 +0200 Subject: [PATCH] Fix friends removal --- shell/view/BuddyIcon.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shell/view/BuddyIcon.py b/shell/view/BuddyIcon.py index 05aaa841..4fec55b0 100644 --- a/shell/view/BuddyIcon.py +++ b/shell/view/BuddyIcon.py @@ -20,17 +20,19 @@ class BuddyIcon(MenuIcon): def _popup_action_cb(self, popup, action): self.popdown() + model = self._shell.get_model() + + if action == BuddyMenu.ACTION_REMOVE_FRIEND: + friends = model.get_friends() + friends.remove(self._friend) + buddy = self._friend.get_buddy() if buddy == None: return - model = self._shell.get_model() if action == BuddyMenu.ACTION_INVITE: activity = model.get_current_activity() activity.invite(buddy) elif action == BuddyMenu.ACTION_MAKE_FRIEND: friends = model.get_friends() friends.make_friend(buddy) - elif action == BuddyMenu.ACTION_REMOVE_FRIEND: - friends = model.get_friends() - friends.remove(buddy)