From e2e709e3d21baa565bd6d1ae8439ecf1d5f0104c Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 11 Nov 2019 12:06:42 +1100 Subject: [PATCH] Fix crash --- Signal/src/Loki/Messaging/FriendRequestView.swift | 2 +- SignalServiceKit/src/Contacts/TSThread.m | 2 +- SignalServiceKit/src/Loki/API/LokiAPI.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Signal/src/Loki/Messaging/FriendRequestView.swift b/Signal/src/Loki/Messaging/FriendRequestView.swift index e90cd83fa..68ef42cf1 100644 --- a/Signal/src/Loki/Messaging/FriendRequestView.swift +++ b/Signal/src/Loki/Messaging/FriendRequestView.swift @@ -83,7 +83,7 @@ final class FriendRequestView : UIView { // MARK: Updating @objc private func handleFriendRequestStatusChangedNotification(_ notification: Notification) { let messageID = notification.object as! String - guard messageID == message.uniqueId else { return } + guard messageID == message.uniqueId && TSMessage.fetch(uniqueId: messageID) != nil else { return } // It's possible for the message to be deleted at this point message.reload() updateUI() } diff --git a/SignalServiceKit/src/Contacts/TSThread.m b/SignalServiceKit/src/Contacts/TSThread.m index 2e89ef212..05703ab35 100644 --- a/SignalServiceKit/src/Contacts/TSThread.m +++ b/SignalServiceKit/src/Contacts/TSThread.m @@ -739,7 +739,7 @@ ConversationColorName const kConversationColorName_Default = ConversationColorNa // We want to remove any old incoming friend request messages which are pending if (interactionType == OWSInteractionType_IncomingMessage) { - removeMessage = message.friendRequestStatus == LKMessageFriendRequestStatusPending; + removeMessage = YES; } else { // Or if we're sending then remove any failed friend request messages TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)message; diff --git a/SignalServiceKit/src/Loki/API/LokiAPI.swift b/SignalServiceKit/src/Loki/API/LokiAPI.swift index 208a0bd07..9f64fa39c 100644 --- a/SignalServiceKit/src/Loki/API/LokiAPI.swift +++ b/SignalServiceKit/src/Loki/API/LokiAPI.swift @@ -14,7 +14,7 @@ public final class LokiAPI : NSObject { private static let maxRetryCount: UInt = 8 private static let defaultTimeout: TimeInterval = 20 private static let longPollingTimeout: TimeInterval = 40 - private static let deviceLinkUpdateInterval: TimeInterval = 8 * 60 + private static let deviceLinkUpdateInterval: TimeInterval = 60 private static let receivedMessageHashValuesKey = "receivedMessageHashValuesKey" private static let receivedMessageHashValuesCollection = "receivedMessageHashValuesCollection" private static var userIDScanLimit: UInt = 4096