mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Debug
This commit is contained in:
parent
7475c7c6b8
commit
26d005a76d
|
@ -712,6 +712,12 @@ typedef enum : NSUInteger {
|
|||
[SSKEnvironment.shared.profileManager ensureProfileCachedForContactWithID:self.thread.contactIdentifier with:transaction];
|
||||
}];
|
||||
}
|
||||
|
||||
if ([self.thread isKindOfClass:TSContactThread.class]) {
|
||||
[LKStorage writeSyncWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||
[LKSessionManagementProtocol sendSessionRequestIfNeededToPublicKey:self.thread.contactIdentifier transaction:transaction];
|
||||
} error:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)createContents
|
||||
|
|
|
@ -64,6 +64,7 @@ public final class SessionManagementProtocol : NSObject {
|
|||
public static func shouldUseFallbackEncryption(for message: TSOutgoingMessage, recipientID: String, transaction: YapDatabaseReadWriteTransaction) -> Bool {
|
||||
if message is SessionRequestMessage { return true }
|
||||
else if let message = message as? DeviceLinkMessage, message.kind == .request { return true }
|
||||
else if message is OWSOutgoingNullMessage { return false }
|
||||
return !storage.containsSession(recipientID, deviceId: Int32(OWSDevicePrimaryDeviceId), protocolContext: transaction)
|
||||
}
|
||||
|
||||
|
|
|
@ -1543,6 +1543,12 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
|
|||
|
||||
BOOL shouldUseFallbackEncryption = [LKSessionManagementProtocol shouldUseFallbackEncryptionForMessage:message recipientID:recipientID transaction:transaction];
|
||||
|
||||
if (shouldUseFallbackEncryption) {
|
||||
[LKLogger print:@"[Loki] Using fallback encryption"];
|
||||
} else {
|
||||
[LKLogger print:@"[Loki] Using Signal Encryption"];
|
||||
}
|
||||
|
||||
serializedMessage = [secretCipher throwswrapped_encryptMessageWithRecipientPublicKey:recipientID
|
||||
deviceID:@(OWSDevicePrimaryDeviceId).intValue
|
||||
paddedPlaintext:plainText.paddedMessageBody
|
||||
|
|
Loading…
Reference in a new issue