Dont show encryption methods if not supported
This commit is contained in:
parent
7040ea6b2e
commit
764b275394
2 changed files with 6 additions and 2 deletions
|
@ -218,7 +218,8 @@ class ChatControl(ChatControlBase):
|
||||||
|
|
||||||
self.encryption_menu = self.xml.get_object('encryption_menu')
|
self.encryption_menu = self.xml.get_object('encryption_menu')
|
||||||
self.encryption_menu.set_menu_model(
|
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()
|
self.set_encryption_menu_icon()
|
||||||
# restore previous conversation
|
# restore previous conversation
|
||||||
self.restore_conversation()
|
self.restore_conversation()
|
||||||
|
|
|
@ -827,7 +827,7 @@ def build_bookmark_menu(account):
|
||||||
menu.insert_submenu(1, label, bookmark_menu)
|
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 = Gio.Menu()
|
||||||
menu.append(
|
menu.append(
|
||||||
'Disabled', 'win.set-encryption-{}::{}'.format(control_id, 'disabled'))
|
'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 type_id == 'pm':
|
||||||
if not hasattr(plugin, 'allow_privatchat'):
|
if not hasattr(plugin, 'allow_privatchat'):
|
||||||
continue
|
continue
|
||||||
|
if zeroconf:
|
||||||
|
if not hasattr(plugin, 'allow_zeroconf'):
|
||||||
|
continue
|
||||||
menu_action = 'win.set-encryption-{}::{}'.format(
|
menu_action = 'win.set-encryption-{}::{}'.format(
|
||||||
control_id, name)
|
control_id, name)
|
||||||
menu.append(name, menu_action)
|
menu.append(name, menu_action)
|
||||||
|
|
Loading…
Add table
Reference in a new issue