mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
clearer message to validate ZRTP SAS
This commit is contained in:
parent
e5c25af545
commit
009db98d8e
3 changed files with 32 additions and 6 deletions
|
|
@ -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:^() {
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Reference in a new issue