Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
Fix updating friend request status when sending message.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikunj committed May 5, 2020
1 parent 04c71c5 commit a10cec6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public class SMKDecryptResult: NSObject {
paddedPlaintext: Data,
senderCertificate: SMKSenderCertificate,
protocolContext: Any?,
isFriendRequest: Bool) throws -> Data {
useFallbackSessionCipher: Bool) throws -> Data {
guard recipientId.count > 0 else {
throw SMKError.assertionError(description: "\(SMKSecretSessionCipher.logTag) invalid recipientId")
}
Expand All @@ -177,7 +177,7 @@ public class SMKDecryptResult: NSObject {
}

var encryptedMessage: CipherMessage
if (isFriendRequest) {
if (useFallbackSessionCipher) {
let privateKey = identityStore.identityKeyPair(protocolContext)?.privateKey
let cipher = FallBackSessionCipher(recipientId: recipientId, privateKey: privateKey)
encryptedMessage = LokiFriendRequestMessage.init(_throws_with: cipher.encrypt(message: paddedPlaintext)!)
Expand Down

0 comments on commit a10cec6

Please sign in to comment.