From 8fb5e7102fc0f27e085dbf66e27dd7f80cc94560 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Wed, 27 May 2020 11:55:04 +1000 Subject: [PATCH] Clean --- .../LokiSessionResetImplementation.swift | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/SignalServiceKit/src/Loki/Protocol/Session Management/LokiSessionResetImplementation.swift b/SignalServiceKit/src/Loki/Protocol/Session Management/LokiSessionResetImplementation.swift index 2d0d47e3f..025e42ee5 100644 --- a/SignalServiceKit/src/Loki/Protocol/Session Management/LokiSessionResetImplementation.swift +++ b/SignalServiceKit/src/Loki/Protocol/Session Management/LokiSessionResetImplementation.swift @@ -16,18 +16,16 @@ public class LokiSessionResetImplementation : NSObject, SessionResetProtocol { public func validatePreKeyForFriendRequestAcceptance(for recipientID: String, whisperMessage: CipherMessage, protocolContext: Any?) throws { guard let transaction = protocolContext as? YapDatabaseReadTransaction else { - print("[Loki] Couldn't verify friend request acceptance pre key because an invalid transaction was provided.") + print("[Loki] Couldn't verify friend request accepted message because an invalid transaction was provided.") return } guard let preKeyMessage = whisperMessage as? PreKeyWhisperMessage else { return } guard let storedPreKey = storage.getPreKeyRecord(forContact: recipientID, transaction: transaction) else { print("[Loki] Received a friend request accepted message from a public key for which no pre key bundle was created.") - // FIXME: Don't throw an error for now as a way to de-bork some existing clients. For example, Simon's Android device was - // somehow triggering this and causing iOS to discard all messages received from him. - return + throw Errors.invalidPreKey } guard storedPreKey.id == preKeyMessage.prekeyID else { - print("[Loki] Received a `PreKeyWhisperMessage` (friend request acceptance) from an unknown source.") + print("[Loki] Received a `PreKeyWhisperMessage` (friend request accepted message) from an unknown source.") throw Errors.preKeyIDsDontMatch } }