[pgp] Show correct message encryption icon

This commit is contained in:
Philipp Hörist
2018-11-09 23:15:24 +01:00
parent f9bea2d6bb
commit a7c7689cc8

View File

@@ -157,6 +157,7 @@ class OldPGPPlugin(GajimPlugin):
key_id = app.config.get_per('accounts', account, 'keyid') key_id = app.config.get_per('accounts', account, 'keyid')
if key_id: if key_id:
obj.encrypted = self.encryption_name obj.encrypted = self.encryption_name
self.add_additional_data(obj.additional_data)
self.decrypt_queue.put([encmsg, key_id, obj, conn, callback]) self.decrypt_queue.put([encmsg, key_id, obj, conn, callback])
if not self.thread: if not self.thread:
self.thread = threading.Thread(target=self.worker) self.thread = threading.Thread(target=self.worker)
@@ -255,6 +256,7 @@ class OldPGPPlugin(GajimPlugin):
# Set xhtml to None so it doesnt get logged # Set xhtml to None so it doesnt get logged
obj.xhtml = None obj.xhtml = None
obj.encrypted = self.encryption_name obj.encrypted = self.encryption_name
self.add_additional_data(obj.additional_data)
print_msg_to_log(obj.msg_iq) print_msg_to_log(obj.msg_iq)
callback(obj) callback(obj)
@@ -282,7 +284,7 @@ class OldPGPPlugin(GajimPlugin):
return return
GLib.idle_add(callback, file) GLib.idle_add(callback, file)
@staticmethod @staticmethod
def _on_file_encryption_error(file, error): def _on_file_encryption_error(file, error):
dialogs.ErrorDialog( dialogs.ErrorDialog(
_('Error'), error, transient_for=file.control.parent_win.window) _('Error'), error, transient_for=file.control.parent_win.window)
@@ -301,6 +303,9 @@ class OldPGPPlugin(GajimPlugin):
stanza.addChild(node=node) stanza.addChild(node=node)
obj.msg_iq = stanza obj.msg_iq = stanza
def add_additional_data(self, data):
data['encrypted'] = {'name': self.encryption_name}
def print_msg_to_log(stanza): def print_msg_to_log(stanza):
""" Prints a stanza in a fancy way to the log """ """ Prints a stanza in a fancy way to the log """