|
|
@ -245,7 +245,9 @@ public final class FriendRequestProtocol : NSObject {
|
|
|
|
// Signal cipher decryption and thus that we have a session with the other person.
|
|
|
|
// Signal cipher decryption and thus that we have a session with the other person.
|
|
|
|
let friendRequestStatus = storage.getFriendRequestStatus(for: hexEncodedPublicKey, transaction: transaction);
|
|
|
|
let friendRequestStatus = storage.getFriendRequestStatus(for: hexEncodedPublicKey, transaction: transaction);
|
|
|
|
// We shouldn't be able to skip from none to friends
|
|
|
|
// We shouldn't be able to skip from none to friends
|
|
|
|
guard friendRequestStatus != .none && friendRequestStatus != .friends else { return }
|
|
|
|
guard friendRequestStatus == .requestSending ||
|
|
|
|
|
|
|
|
friendRequestStatus == .requestSent ||
|
|
|
|
|
|
|
|
friendRequestStatus == .requestReceived else { return }
|
|
|
|
// Become friends
|
|
|
|
// Become friends
|
|
|
|
storage.setFriendRequestStatus(.friends, for: hexEncodedPublicKey, transaction: transaction)
|
|
|
|
storage.setFriendRequestStatus(.friends, for: hexEncodedPublicKey, transaction: transaction)
|
|
|
|
// Send a contact sync message if needed
|
|
|
|
// Send a contact sync message if needed
|
|
|
|