From 2aaf67dfe2daa6a8949709acea9abfe7f2fcb462 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Fri, 21 Feb 2014 10:15:52 +0100 Subject: [PATCH] Fix ZRTP popup glitch --- Classes/LinphoneUI/UIStateBar.h | 2 +- Classes/LinphoneUI/UIStateBar.m | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Classes/LinphoneUI/UIStateBar.h b/Classes/LinphoneUI/UIStateBar.h index c9f80b725..8103c6f37 100644 --- a/Classes/LinphoneUI/UIStateBar.h +++ b/Classes/LinphoneUI/UIStateBar.h @@ -21,7 +21,7 @@ #import "TPMultiLayoutViewController.h" #import "DTActionSheet.h" -@interface UIStateBar : TPMultiLayoutViewController { +@interface UIStateBar : TPMultiLayoutViewController { DTActionSheet *securitySheet; } diff --git a/Classes/LinphoneUI/UIStateBar.m b/Classes/LinphoneUI/UIStateBar.m index fcc7068b3..b2e485d84 100644 --- a/Classes/LinphoneUI/UIStateBar.m +++ b/Classes/LinphoneUI/UIStateBar.m @@ -266,14 +266,15 @@ NSTimer *callSecurityTimer; message = [NSString stringWithFormat:NSLocalizedString(@"Confirm the following SAS with the peer:\n%s",nil), linphone_call_get_authentication_token(call)]; } - if(securitySheet == nil) { + if( securitySheet == nil ){ securitySheet = [[DTActionSheet alloc] initWithTitle:message]; + [securitySheet setDelegate:self]; [securitySheet addButtonWithTitle:NSLocalizedString(@"Ok",nil) block:^(){ linphone_call_set_authentication_token_verified(call, !valid); [securitySheet release]; securitySheet = nil; }]; - + [securitySheet addDestructiveButtonWithTitle:NSLocalizedString(@"Cancel",nil) block:^(){ [securitySheet release]; securitySheet = nil; @@ -285,6 +286,10 @@ NSTimer *callSecurityTimer; } } +-(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{ + [securitySheet release]; + securitySheet = nil; +} #pragma mark - TPMultiLayoutViewController Functions