|
|
@ -1451,12 +1451,6 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
|
|
|
|
SignalRecipient *recipient = messageSend.recipient;
|
|
|
|
SignalRecipient *recipient = messageSend.recipient;
|
|
|
|
OWSAssertDebug(recipientID.length > 0);
|
|
|
|
OWSAssertDebug(recipientID.length > 0);
|
|
|
|
|
|
|
|
|
|
|
|
__block BOOL hasSession;
|
|
|
|
|
|
|
|
[LKStorage writeSyncWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
|
|
|
|
hasSession = [storage containsSession:recipientID deviceId:[deviceId intValue] protocolContext:transaction];
|
|
|
|
|
|
|
|
} error:nil];
|
|
|
|
|
|
|
|
if (hasSession) { return YES; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Discard "typing indicator" messages if there is no existing session with the user.
|
|
|
|
// Discard "typing indicator" messages if there is no existing session with the user.
|
|
|
|
BOOL canSafelyBeDiscarded = messageSend.message.isOnline;
|
|
|
|
BOOL canSafelyBeDiscarded = messageSend.message.isOnline;
|
|
|
|
if (canSafelyBeDiscarded) {
|
|
|
|
if (canSafelyBeDiscarded) {
|
|
|
@ -1467,6 +1461,12 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
|
|
|
|
__block NSException *exception;
|
|
|
|
__block NSException *exception;
|
|
|
|
|
|
|
|
|
|
|
|
if (!bundle) {
|
|
|
|
if (!bundle) {
|
|
|
|
|
|
|
|
__block BOOL hasSession;
|
|
|
|
|
|
|
|
[LKStorage writeSyncWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
|
|
|
|
hasSession = [storage containsSession:recipientID deviceId:[deviceId intValue] protocolContext:transaction];
|
|
|
|
|
|
|
|
} error:nil];
|
|
|
|
|
|
|
|
if (hasSession) { return YES; }
|
|
|
|
|
|
|
|
|
|
|
|
TSOutgoingMessage *message = messageSend.message;
|
|
|
|
TSOutgoingMessage *message = messageSend.message;
|
|
|
|
// Loki: Remove this when we have shared sender keys
|
|
|
|
// Loki: Remove this when we have shared sender keys
|
|
|
|
// ========
|
|
|
|
// ========
|
|
|
|