From 14164d98559de4f06f93bbce6809d640d5323959 Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Fri, 16 Jan 2015 15:54:48 +0100 Subject: [PATCH] Closes #359 //FREEBIE --- Signal/src/AppDelegate.m | 43 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index dee506ba3..2cbce64d8 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -182,27 +182,28 @@ } -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { - ResponderSessionDescriptor* call; - - if (![self.notificationTracker shouldProcessNotification:userInfo]){ - return; - } - - @try { - call = [ResponderSessionDescriptor responderSessionDescriptorFromEncryptedRemoteNotification:userInfo]; - DDLogDebug(@"Received remote notification. Parsed session descriptor: %@.", call); - self.callPickUpFuture = [TOCFutureSource new]; - } @catch (OperationFailed* ex) { - DDLogError(@"Error parsing remote notification. Error: %@.", ex); - return; - } - - if (!call) { - DDLogError(@"Decryption of session descriptor failed"); - return; - } - - [Environment.phoneManager incomingCallWithSession:call]; + if ([self isRedPhonePush:userInfo]) { + ResponderSessionDescriptor* call; + if (![self.notificationTracker shouldProcessNotification:userInfo]){ + return; + } + + @try { + call = [ResponderSessionDescriptor responderSessionDescriptorFromEncryptedRemoteNotification:userInfo]; + DDLogDebug(@"Received remote notification. Parsed session descriptor: %@.", call); + self.callPickUpFuture = [TOCFutureSource new]; + } @catch (OperationFailed* ex) { + DDLogError(@"Error parsing remote notification. Error: %@.", ex); + return; + } + + if (!call) { + DDLogError(@"Decryption of session descriptor failed"); + return; + } + + [Environment.phoneManager incomingCallWithSession:call]; + } } - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {