request ad-hoc commands to muc occupant real JID if room is not anonymous. Fixes #2820
This commit is contained in:
parent
2ac8607ed6
commit
395bf4fd99
|
@ -272,7 +272,8 @@ class PrivateChatControl(ChatControl):
|
|||
use_multiple_contacts=False, show_start_chat=False,
|
||||
show_encryption=True, control=self,
|
||||
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
|
||||
|
||||
class GroupchatControl(ChatControlBase):
|
||||
|
|
|
@ -153,7 +153,7 @@ def build_invite_submenu(invite_menuitem, list_, ignore_rooms=[]):
|
|||
|
||||
def get_contact_menu(contact, account, use_multiple_contacts=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,
|
||||
we hide invite_contacts_menuitem
|
||||
|
@ -236,8 +236,14 @@ control=None, gc_contact=None):
|
|||
|
||||
if contact.supports(NS_COMMANDS):
|
||||
execute_command_menuitem.set_sensitive(True)
|
||||
execute_command_menuitem.connect('activate', roster.on_execute_command,
|
||||
contact, account, contact.resource)
|
||||
if gc_contact and gc_contact.jid and not is_anonymous:
|
||||
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:
|
||||
execute_command_menuitem.set_sensitive(False)
|
||||
|
||||
|
|
Loading…
Reference in New Issue