Fix crash

This commit is contained in:
Niels Andriesse 2019-11-11 12:06:42 +11:00
parent e6afbe2bfb
commit e2e709e3d2
3 changed files with 3 additions and 3 deletions

View file

@ -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()
}

View file

@ -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;

View file

@ -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