fix inviting several contacts to a room. And don't allow to invite transports. Fixes 7527
This commit is contained in:
parent
b38fac4abe
commit
812e8c331d
|
@ -109,8 +109,18 @@ def build_invite_submenu(invite_menuitem, list_, ignore_rooms=[]):
|
||||||
resource = None
|
resource = None
|
||||||
invite_to_new_room_menuitem.connect('activate',
|
invite_to_new_room_menuitem.connect('activate',
|
||||||
roster.on_invite_to_new_room, list_, resource)
|
roster.on_invite_to_new_room, list_, resource)
|
||||||
|
elif len(list_) > 1:
|
||||||
|
list2 = []
|
||||||
|
for (c, a) in list_:
|
||||||
|
if c.supports(NS_MUC):
|
||||||
|
list2.append((c, a))
|
||||||
|
if len(list2) > 0:
|
||||||
|
invite_to_new_room_menuitem.connect('activate',
|
||||||
|
roster.on_invite_to_new_room, list2, None)
|
||||||
else:
|
else:
|
||||||
invite_menuitem.set_sensitive(True)
|
invite_menuitem.set_sensitive(False)
|
||||||
|
else:
|
||||||
|
invite_menuitem.set_sensitive(False)
|
||||||
# transform None in 'jabber'
|
# transform None in 'jabber'
|
||||||
c_t = contacts_transport or 'jabber'
|
c_t = contacts_transport or 'jabber'
|
||||||
muc_jid = {}
|
muc_jid = {}
|
||||||
|
|
|
@ -5782,12 +5782,15 @@ class RosterWindow:
|
||||||
self.on_send_single_message_menuitem_activate, account, list_)
|
self.on_send_single_message_menuitem_activate, account, list_)
|
||||||
|
|
||||||
# Invite to
|
# Invite to
|
||||||
invite_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(_('In_vite to'))
|
if group != _('Transports'):
|
||||||
|
invite_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(
|
||||||
|
_('In_vite to'))
|
||||||
muc_icon = gtkgui_helpers.load_icon('muc_active')
|
muc_icon = gtkgui_helpers.load_icon('muc_active')
|
||||||
if muc_icon:
|
if muc_icon:
|
||||||
invite_menuitem.set_image(muc_icon)
|
invite_menuitem.set_image(muc_icon)
|
||||||
|
|
||||||
gui_menu_builder.build_invite_submenu(invite_menuitem, list_online)
|
gui_menu_builder.build_invite_submenu(invite_menuitem,
|
||||||
|
list_online)
|
||||||
menu.append(invite_menuitem)
|
menu.append(invite_menuitem)
|
||||||
|
|
||||||
# Send Custom Status
|
# Send Custom Status
|
||||||
|
|
Loading…
Reference in New Issue