Move remove code down to fix undefined var error
This commit is contained in:
parent
66124465e8
commit
f9012b88f6
@ -20,18 +20,17 @@ class BuddyIcon(MenuIcon):
|
|||||||
def _popup_action_cb(self, popup, action):
|
def _popup_action_cb(self, popup, action):
|
||||||
self.popdown()
|
self.popdown()
|
||||||
|
|
||||||
model = self._shell.get_model()
|
|
||||||
if action == BuddyMenu.ACTION_REMOVE_FRIEND:
|
|
||||||
friends = model.get_friends()
|
|
||||||
friends.remove(buddy)
|
|
||||||
|
|
||||||
buddy = self._friend.get_buddy()
|
buddy = self._friend.get_buddy()
|
||||||
if buddy == None:
|
if buddy == None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
model = self._shell.get_model()
|
||||||
if action == BuddyMenu.ACTION_INVITE:
|
if action == BuddyMenu.ACTION_INVITE:
|
||||||
activity = model.get_current_activity()
|
activity = model.get_current_activity()
|
||||||
activity.invite(buddy)
|
activity.invite(buddy)
|
||||||
elif action == BuddyMenu.ACTION_MAKE_FRIEND:
|
elif action == BuddyMenu.ACTION_MAKE_FRIEND:
|
||||||
friends = model.get_friends()
|
friends = model.get_friends()
|
||||||
friends.make_friend(buddy)
|
friends.make_friend(buddy)
|
||||||
|
elif action == BuddyMenu.ACTION_REMOVE_FRIEND:
|
||||||
|
friends = model.get_friends()
|
||||||
|
friends.remove(buddy)
|
||||||
|
Loading…
Reference in New Issue
Block a user