request ad-hoc commands to muc occupant real JID if room is not anonymous. Fixes #2820

This commit is contained in:
Yann Leboulanger 2012-04-16 23:03:30 +02:00
parent 2ac8607ed6
commit 395bf4fd99
2 changed files with 11 additions and 4 deletions

View File

@ -272,7 +272,8 @@ class PrivateChatControl(ChatControl):
use_multiple_contacts=False, show_start_chat=False, use_multiple_contacts=False, show_start_chat=False,
show_encryption=True, control=self, show_encryption=True, control=self,
show_buttonbar_items=not hide_buttonbar_items, show_buttonbar_items=not hide_buttonbar_items,
gc_contact=self.gc_contact) gc_contact=self.gc_contact,
is_anonymous=self.room_ctrl.is_anonymous)
return menu return menu
class GroupchatControl(ChatControlBase): class GroupchatControl(ChatControlBase):

View File

@ -153,7 +153,7 @@ def build_invite_submenu(invite_menuitem, list_, ignore_rooms=[]):
def get_contact_menu(contact, account, use_multiple_contacts=True, def get_contact_menu(contact, account, use_multiple_contacts=True,
show_start_chat=True, show_encryption=False, show_buttonbar_items=True, show_start_chat=True, show_encryption=False, show_buttonbar_items=True,
control=None, gc_contact=None): control=None, gc_contact=None, is_anonymous=True):
""" """
Build contact popup menu for roster and chat window. If control is not set, Build contact popup menu for roster and chat window. If control is not set,
we hide invite_contacts_menuitem we hide invite_contacts_menuitem
@ -236,8 +236,14 @@ control=None, gc_contact=None):
if contact.supports(NS_COMMANDS): if contact.supports(NS_COMMANDS):
execute_command_menuitem.set_sensitive(True) execute_command_menuitem.set_sensitive(True)
execute_command_menuitem.connect('activate', roster.on_execute_command, if gc_contact and gc_contact.jid and not is_anonymous:
contact, account, contact.resource) execute_command_menuitem.connect('activate',
roster.on_execute_command, gc_contact, account,
gc_contact.resource)
else:
execute_command_menuitem.connect('activate',
roster.on_execute_command, contact, account,
contact.resource)
else: else:
execute_command_menuitem.set_sensitive(False) execute_command_menuitem.set_sensitive(False)