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):
else:
sender = ChatSender(message.sender.display_name or session.name, uri, session.icon.filename)
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)
session.chat_widget.update_message_text(message.id, content)
else:
......
......@@ -701,16 +701,13 @@ class MessageManager(object, metaclass=Singleton):
encryption = self.check_encryption(content_type, body)
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)):
for request in self.pgp_requests[account, GeneratePGPKeyRequest]:
return
if not self.pgp_requests[account, GeneratePGPKeyRequest]:
generate_dialog = GeneratePGPKeyDialog()
generate_request = GeneratePGPKeyRequest(generate_dialog, account, 0)
generate_request.accepted.connect(self._SH_GeneratePGPKeys)
generate_request.finished.connect(self._SH_PGPRequestFinished)
bisect.insort_right(self.pgp_requests, generate_request)
generate_request.dialog.show()
elif not account.sms.enable_pgp:
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