Commit 764b2753 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Dont show encryption methods if not supported

parent 7040ea6b
......@@ -218,7 +218,8 @@ def __init__(self, parent_win, contact, acct, session, resource=None):
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment