|
|
|
@ -10,7 +10,7 @@
|
|
|
|
|
#import "OWSBackgroundTask.h"
|
|
|
|
|
#import "OWSBatchMessageProcessor.h"
|
|
|
|
|
#import "OWSMessageDecrypter.h"
|
|
|
|
|
#import "OWSPrimaryStorage.h"
|
|
|
|
|
#import "OWSPrimaryStorage+Loki.h"
|
|
|
|
|
#import "OWSQueues.h"
|
|
|
|
|
#import "OWSStorage.h"
|
|
|
|
|
#import "OWSIdentityManager.h"
|
|
|
|
@ -404,6 +404,16 @@ NSString *const OWSMessageDecryptJobFinderExtensionGroup = @"OWSMessageProcessin
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Loki: Ignore any friend requests that we got before restoration
|
|
|
|
|
uint64_t restorationTime = [NSNumber numberWithDouble:[OWSPrimaryStorage.sharedManager getRestorationTime]].unsignedLongLongValue;
|
|
|
|
|
if (envelope.type == SSKProtoEnvelopeTypeFriendRequest && envelope.timestamp < restorationTime * 1000) {
|
|
|
|
|
OWSLogDebug(@"Ignoring friend request that was received before restoration.");
|
|
|
|
|
dispatch_async(self.serialQueue, ^{
|
|
|
|
|
completion(YES);
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// We use the original envelope for this check;
|
|
|
|
|
// the decryption process might rewrite the envelope.
|
|
|
|
|
BOOL wasReceivedByUD = [self wasReceivedByUD:envelope];
|
|
|
|
|