Commit d1297740 authored by Tijmen de Mes's avatar Tijmen de Mes

Fixed handling/displaying encrypted messages when no key is present

parent 47a848fe
...@@ -2379,7 +2379,7 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin): ...@@ -2379,7 +2379,7 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
else: else:
sender = ChatSender(message.sender.display_name or session.name, uri, session.icon.filename) sender = ChatSender(message.sender.display_name or session.name, uri, session.icon.filename)
if session.chat_widget.history_loaded: if session.chat_widget.history_loaded:
if message in self.pending_decryption: if message in self.pending_decryption and not encrypted:
self.pending_decryption.remove(message) self.pending_decryption.remove(message)
session.chat_widget.update_message_text(message.id, content) session.chat_widget.update_message_text(message.id, content)
else: else:
......
...@@ -701,16 +701,13 @@ class MessageManager(object, metaclass=Singleton): ...@@ -701,16 +701,13 @@ class MessageManager(object, metaclass=Singleton):
encryption = self.check_encryption(content_type, body) encryption = self.check_encryption(content_type, body)
if encryption == 'OpenPGP': if encryption == 'OpenPGP':
if account.sms.enable_pgp and (account.sms.private_key is None or not os.path.exists(account.sms.private_key.normalized)): if account.sms.enable_pgp and (account.sms.private_key is None or not os.path.exists(account.sms.private_key.normalized)):
for request in self.pgp_requests[account, GeneratePGPKeyRequest]: if not self.pgp_requests[account, GeneratePGPKeyRequest]:
return generate_dialog = GeneratePGPKeyDialog()
generate_request = GeneratePGPKeyRequest(generate_dialog, account, 0)
generate_dialog = GeneratePGPKeyDialog() generate_request.accepted.connect(self._SH_GeneratePGPKeys)
generate_request = GeneratePGPKeyRequest(generate_dialog, account, 0) generate_request.finished.connect(self._SH_PGPRequestFinished)
generate_request.accepted.connect(self._SH_GeneratePGPKeys) bisect.insort_right(self.pgp_requests, generate_request)
generate_request.finished.connect(self._SH_PGPRequestFinished) generate_request.dialog.show()
bisect.insort_right(self.pgp_requests, generate_request)
generate_request.dialog.show()
elif not account.sms.enable_pgp: elif not account.sms.enable_pgp:
return return
......
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