From c9d0d86721fa6cb756445f2faca605ce29663fc1 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 28 Jan 2013 16:13:46 +0100 Subject: [PATCH] Fix badge and no video issue --- Classes/BuschJaegerCallView.m | 5 ++--- Classes/BuschJaegerCallView.xib | 12 ++++++------ Classes/BuschJaegerMainView.m | 15 +++------------ Classes/LinphoneManager.m | 9 ++++++++- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/Classes/BuschJaegerCallView.m b/Classes/BuschJaegerCallView.m index 08f428c3a..ea0e3cb4b 100644 --- a/Classes/BuschJaegerCallView.m +++ b/Classes/BuschJaegerCallView.m @@ -129,9 +129,6 @@ [takeCallButton makeRoundWithCorner:(UIRectCornerBottomLeft|UIRectCornerTopLeft) radius:(takeCallButton.bounds.size.height/2.0)]; } - linphone_core_set_native_video_window_id([LinphoneManager getLc], (unsigned long)videoView); - linphone_core_set_native_preview_window_id([LinphoneManager getLc], 0); - videoZoomHandler = [[VideoZoomHandler alloc] init]; [videoZoomHandler setup:videoView]; @@ -192,6 +189,8 @@ } // Update on show + linphone_core_set_native_video_window_id([LinphoneManager getLc], (unsigned long)videoView); + linphone_core_set_native_preview_window_id([LinphoneManager getLc], 0); LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); LinphoneCallState state = (call != NULL)?linphone_call_get_state(call): 0; [self callUpdate:call state:state animated:FALSE]; diff --git a/Classes/BuschJaegerCallView.xib b/Classes/BuschJaegerCallView.xib index f803e0116..632afe97f 100644 --- a/Classes/BuschJaegerCallView.xib +++ b/Classes/BuschJaegerCallView.xib @@ -2,13 +2,13 @@ 1536 - 12C60 - 2844 - 1187.34 - 625.00 + 11G63 + 2840 + 1138.51 + 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1930 + 1926 IBProxyObject @@ -585,6 +585,6 @@ {16, 16} {44, 34} - 1930 + 1926 diff --git a/Classes/BuschJaegerMainView.m b/Classes/BuschJaegerMainView.m index f3b459f66..11af398cb 100644 --- a/Classes/BuschJaegerMainView.m +++ b/Classes/BuschJaegerMainView.m @@ -224,11 +224,9 @@ static BuschJaegerMainView* mainViewInstance=nil; [historyQueue addOperationWithBlock:^(void) { if([[LinphoneManager instance] configuration].valid) { NSMutableSet *set = [[[LinphoneManager instance] configuration] getHistory]; - if(set != nil) { - int missed = [set count] - [[[LinphoneManager instance] configuration].history count]; - if(missed < 0) missed = 0; - [[UIApplication sharedApplication] setApplicationIconBadgeNumber:missed]; - } + int missed = [set count] - [[[LinphoneManager instance] configuration].history count]; + if(missed < 0) missed = 0; + [[UIApplication sharedApplication] setApplicationIconBadgeNumber:missed]; } }]; } @@ -300,13 +298,6 @@ static BuschJaegerMainView* mainViewInstance=nil; [self dismissIncomingCall:call]; if ((linphone_core_get_calls([LinphoneManager getLc]) == NULL)) { [navigationController popToViewController:welcomeView animated:FALSE]; // No animation... Come back when Apple have learned how to create a good framework - } - LinphoneCallLog *log = linphone_call_get_call_log(call); - if(log != NULL && log->status == LinphoneCallMissed) { - // We can't use the comparison method, we can be in background mode and the application - // will no send/update the http request - int missed = [[UIApplication sharedApplication] applicationIconBadgeNumber]; - [[UIApplication sharedApplication] setApplicationIconBadgeNumber:++missed]; } break; } diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 5c22d9e11..082934eb8 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -490,6 +490,13 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char // Disable speaker when no more call if ((state == LinphoneCallEnd || state == LinphoneCallError)) { + LinphoneCallLog *log = linphone_call_get_call_log(call); + if(log != NULL && log->status == LinphoneCallMissed) { + // We can't use the comparison method, we can be in background mode and the application + // will no send/update the http request + int missed = [[UIApplication sharedApplication] applicationIconBadgeNumber]; + [[UIApplication sharedApplication] setApplicationIconBadgeNumber:++missed]; + } if(linphone_core_get_calls_nb(theLinphoneCore) == 0) { [self setSpeakerEnabled:FALSE]; [self removeCTCallCenterCb]; @@ -596,7 +603,7 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo && [UIApplication sharedApplication].applicationState != UIApplicationStateActive) { - NSString *ringtone = [NSString stringWithFormat:@"%@_loop.wav", [[NSUserDefaults standardUserDefaults] stringForKey:@"level_ringtone_preference"], nil]; + NSString *ringtone = [NSString stringWithFormat:@"%@.wav", [[NSUserDefaults standardUserDefaults] stringForKey:@"level_ringtone_preference"], nil]; // Create a new notification UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease];