changeset 47bd067b9ae2 in /home/hg/repos/gajim-plugins
author: Bahtiar `kalkin-` Gadimov bahtiar@gadimov.de branches: details:gajim-plugins?cmd=changeset;node=47bd067b9ae2 description: Refactor encryption en/disabled code
- All the logic is in the Checkbox - Use unicode LOCK & OPEN_LOCK chars
diffstat:
omemo/ui.py | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-)
diffs (34 lines):
diff -r a90727b49800 -r 47bd067b9ae2 omemo/ui.py --- a/omemo/ui.py Thu Jan 07 23:32:07 2016 +0100 +++ b/omemo/ui.py Thu Jan 07 23:39:38 2016 +0100 @@ -75,9 +75,14 @@ if enabled: self.plugin.omemo_enable_for(self.contact) self.chat_control._show_lock_image(True, 'OMEMO', True, True, False) + self.chat_control.print_conversation_line( + u'\U0001F512 OMEMO encryption enabled ', 'status', '', None) else: self.plugin.omemo_disable_for(self.contact) - self.chat_control._show_lock_image(False, 'OMEMO', False, True, False) + self.chat_control._show_lock_image(False, 'OMEMO', False, True, + False) + self.chat_control.print_conversation_line( + u'\U0001F513 OMEMO encryption disabled', 'status', '', None)
def _add_widget(widget, chat_control): @@ -124,14 +129,7 @@
def activate_omemo(self): if not self.checkbox.get_active(): - self.chat_control.print_conversation_line( - 'OMEMO encryption activated', 'status', '', None) - self.chat_control._show_lock_image(True, 'OMEMO', True, True, True) self.checkbox.set_active(True) - elif self.last_msg_plain: - self.chat_control.print_conversation_line( - 'OMEMO encryption activated', 'status', '', None) - self.last_msg_plain = False
def plain_warning(self): if not self.last_msg_plain: