From 2968c3d64a6c16b6cf40a88a6ab5496a684280f7 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Tue, 5 May 2020 13:29:20 +1000 Subject: [PATCH] Fix incorrect order of operations --- .../src/Loki/Protocol/Sync Messages/SyncMessagesProtocol.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SignalServiceKit/src/Loki/Protocol/Sync Messages/SyncMessagesProtocol.swift b/SignalServiceKit/src/Loki/Protocol/Sync Messages/SyncMessagesProtocol.swift index b091b11b8..15a404543 100644 --- a/SignalServiceKit/src/Loki/Protocol/Sync Messages/SyncMessagesProtocol.swift +++ b/SignalServiceKit/src/Loki/Protocol/Sync Messages/SyncMessagesProtocol.swift @@ -189,9 +189,10 @@ public final class SyncMessagesProtocol : NSObject { } }) case .requestReceived: - storage.setFriendRequestStatus(.friends, for: hexEncodedPublicKey, transaction: transaction) // Not sendFriendRequestAcceptanceMessage(to:using:) to take into account multi device FriendRequestProtocol.acceptFriendRequest(from: hexEncodedPublicKey, using: transaction) + // It's important that the line below happens after the one above + storage.setFriendRequestStatus(.friends, for: hexEncodedPublicKey, transaction: transaction) default: break } }