diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 95e00897c..a43af202f 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -800,10 +800,22 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response userInfo:sheet repeats:NO]; } else if ([response.notification.request.content.categoryIdentifier isEqual:@"zrtp_request"]) { - [UIConfirmationDialog - ShowWithMessage:[NSString stringWithFormat:NSLocalizedString( - @"Confirm the following SAS with peer:\n%s", nil), - linphone_call_get_authentication_token(call)] + NSString *code = [NSString stringWithUTF8String:linphone_call_get_authentication_token(call)]; + NSString *myCode; + NSString *correspondantCode; + if (linphone_call_get_dir(call) == LinphoneCallIncoming) { + myCode = [code substringToIndex:2]; + correspondantCode = [code substringFromIndex:2]; + } else { + correspondantCode = [code substringToIndex:2]; + myCode = [code substringFromIndex:2]; + } + NSString *message = [NSString stringWithFormat:NSLocalizedString(@"Confirm the following SAS with peer:\n" + @"Say : %@\n" + @"Your correspondant should say : %@", + nil), + myCode, correspondantCode]; + [UIConfirmationDialog ShowWithMessage:message cancelMessage:NSLocalizedString(@"DENY", nil) confirmMessage:NSLocalizedString(@"ACCEPT", nil) onCancelClick:^() { diff --git a/Classes/LinphoneUI/StatusBarView.m b/Classes/LinphoneUI/StatusBarView.m index e0e2c785e..43db8ee5e 100644 --- a/Classes/LinphoneUI/StatusBarView.m +++ b/Classes/LinphoneUI/StatusBarView.m @@ -318,9 +318,23 @@ LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)); if (enc == LinphoneMediaEncryptionZRTP) { + NSString *code = [NSString stringWithUTF8String:linphone_call_get_authentication_token(call)]; + NSString *myCode; + NSString *correspondantCode; + if (linphone_call_get_dir(call) == LinphoneCallIncoming) { + myCode = [code substringToIndex:2]; + correspondantCode = [code substringFromIndex:2]; + } else { + correspondantCode = [code substringToIndex:2]; + myCode = [code substringFromIndex:2]; + } NSString *message = - [NSString stringWithFormat:NSLocalizedString(@"Confirm the following SAS with peer:\n%s", nil), - linphone_call_get_authentication_token(call)]; + [NSString stringWithFormat:NSLocalizedString(@"Confirm the following SAS with peer:\n" + @"Say : %@\n" + @"Your correspondant should say : %@", + nil), + myCode, correspondantCode]; + if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max) { UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init]; diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index deac16018..ac03ac828 100644 Binary files a/Resources/en.lproj/Localizable.strings and b/Resources/en.lproj/Localizable.strings differ