Fix friends removal

This commit is contained in:
Marco Pesenti Gritti 2006-09-22 21:36:52 +02:00
parent 17913d20b8
commit f2b2b8c6ba

View File

@ -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)