Dont show encryption methods if not supported
This commit is contained in:
parent
7040ea6b2e
commit
764b275394
|
@ -218,7 +218,8 @@ class ChatControl(ChatControlBase):
|
|||
|
||||
self.encryption_menu = self.xml.get_object('encryption_menu')
|
||||
self.encryption_menu.set_menu_model(
|
||||
gui_menu_builder.get_encryption_menu(self.control_id, self.type_id))
|
||||
gui_menu_builder.get_encryption_menu(
|
||||
self.control_id, self.type_id, self.account == 'Local'))
|
||||
self.set_encryption_menu_icon()
|
||||
# restore previous conversation
|
||||
self.restore_conversation()
|
||||
|
|
|
@ -827,7 +827,7 @@ def build_bookmark_menu(account):
|
|||
menu.insert_submenu(1, label, bookmark_menu)
|
||||
|
||||
|
||||
def get_encryption_menu(control_id, type_id):
|
||||
def get_encryption_menu(control_id, type_id, zeroconf=False):
|
||||
menu = Gio.Menu()
|
||||
menu.append(
|
||||
'Disabled', 'win.set-encryption-{}::{}'.format(control_id, 'disabled'))
|
||||
|
@ -838,6 +838,9 @@ def get_encryption_menu(control_id, type_id):
|
|||
if type_id == 'pm':
|
||||
if not hasattr(plugin, 'allow_privatchat'):
|
||||
continue
|
||||
if zeroconf:
|
||||
if not hasattr(plugin, 'allow_zeroconf'):
|
||||
continue
|
||||
menu_action = 'win.set-encryption-{}::{}'.format(
|
||||
control_id, name)
|
||||
menu.append(name, menu_action)
|
||||
|
|
Loading…
Reference in New Issue