Skip to content
Snippets Groups Projects
Commit 28cb24a7 authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist
Browse files

Add setting for XEP-0258 Security Labels

parent 3b4956e5
No related branches found
No related tags found
No related merge requests found
......@@ -220,6 +220,7 @@ class _ACCOUNT_DEFAULT:
'gc_send_marker_public_default': False,
'chat_history_max_age': -1,
'enable_gssapi': False,
'enable_security_labels': False,
},
'contact': {
......
......@@ -841,7 +841,7 @@ def __init__(self, account):
'confirm_unencrypted_connection',
desc=_('Show a confirmation dialog before connecting '
'unencrypted')),
]
]
GenericSettingPage.__init__(self, account, settings)
@staticmethod
......@@ -877,8 +877,12 @@ def __init__(self, account):
props={'entries': {'httpupload': _('Upload Files'),
'jingle': _('Send Files Directly')}},
desc=_('Preferred file transfer mechanism for '
'file drag&drop on a chat window'))
]
'file drag&drop on a chat window')),
Setting(SettingKind.SWITCH, _('Security Labels'),
SettingType.ACCOUNT_CONFIG, 'enable_security_labels',
desc=_('Show labels describing confidentiality of '
'messages, if the server supports XEP-0258'))
]
GenericSettingPage.__init__(self, account, settings)
......@@ -905,7 +909,7 @@ def __init__(self, account):
Setting(SettingKind.SWITCH, _('Global Status'),
SettingType.ACCOUNT_CONFIG, 'sync_with_global_status',
desc=_('Synchronize the status of all accounts')),
]
]
GenericSettingPage.__init__(self, account, settings)
......@@ -925,7 +929,7 @@ def __init__(self, account, parent):
Setting(SettingKind.ENTRY, _('Email'),
SettingType.ACCOUNT_CONFIG, 'zeroconf_email'),
]
]
SettingsDialog.__init__(self, parent, _('Profile'),
Gtk.DialogFlags.MODAL, settings, account)
......@@ -951,7 +955,7 @@ def __init__(self, account, parent):
bind='account::adjust_priority_with_status',
inverted=True,
props={'range_': range_}),
]
]
SettingsDialog.__init__(self, parent, _('Priority'),
Gtk.DialogFlags.MODAL, settings, account)
......@@ -990,7 +994,7 @@ def __init__(self, account, parent):
SettingType.ACCOUNT_CONFIG, 'custom_type',
bind='account::use_custom_host',
props={'combo_items': type_values}),
]
]
SettingsDialog.__init__(self, parent, _('Connection Settings'),
Gtk.DialogFlags.MODAL, settings, account)
......@@ -1006,7 +1010,7 @@ def __init__(self, account, parent):
Setting(SettingKind.SWITCH, _('Encrypted Certificate'),
SettingType.ACCOUNT_CONFIG, 'client_cert_encrypted'),
]
]
SettingsDialog.__init__(self, parent, _('Certificate Settings'),
Gtk.DialogFlags.MODAL, settings, account)
......@@ -1029,7 +1033,7 @@ def __init__(self, account, parent):
Setting(SettingKind.SWITCH, _('Use GSSAPI'),
SettingType.ACCOUNT_CONFIG, 'enable_gssapi'),
]
]
SettingsDialog.__init__(self, parent, _('Login Settings'),
Gtk.DialogFlags.MODAL, settings, account)
......
......@@ -457,6 +457,11 @@ def _sec_labels_received(self, event):
if event.jid != jid:
return
if not app.settings.get_account_setting(
event.account, 'enable_security_labels'):
return
model = self.xml.label_selector.get_model()
model.clear()
......
......@@ -114,7 +114,8 @@ def __init__(self,
if encryption_img:
self._meta_box.pack_end(encryption_img, False, True, 0)
if display_marking:
if display_marking and app.settings.get_account_setting(
account, 'enable_security_labels'):
label_text = GLib.markup_escape_text(display_marking.name)
if label_text:
bgcolor = display_marking.bgcolor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment