]> nmode's Git Repositories - signal-cli/commitdiff
Refresh prekeys when receiving message with invalid key id
authorAsamK <asamk@gmx.de>
Mon, 31 Mar 2025 07:11:28 +0000 (09:11 +0200)
committerAsamK <asamk@gmx.de>
Mon, 31 Mar 2025 07:11:28 +0000 (09:11 +0200)
lib/src/main/java/org/asamk/signal/manager/helper/IncomingMessageHandler.java

index 1e808e64af27d36a414cbe52887137cfdfaa2ac2..3bb7479af85053c20479e7088699e5a772785fbb 100644 (file)
@@ -157,6 +157,9 @@ public final class IncomingMessageHandler {
             } catch (ProtocolInvalidKeyIdException | ProtocolInvalidKeyException | ProtocolNoSessionException |
                      ProtocolInvalidMessageException e) {
                 logger.debug("Failed to decrypt incoming message", e);
+                if (e instanceof ProtocolInvalidKeyIdException) {
+                    actions.add(RefreshPreKeysAction.create());
+                }
                 final var sender = account.getRecipientResolver().resolveRecipient(e.getSender());
                 if (context.getContactHelper().isContactBlocked(sender)) {
                     logger.debug("Received invalid message from blocked contact, ignoring.");