Go to history details on missed call notification

This commit is contained in:
Yann Diorcet 2013-01-31 11:43:46 +01:00
parent 70594da3cb
commit 402ff3da1b
2 changed files with 21 additions and 1 deletions

View file

@ -226,6 +226,26 @@
if(controller != nil) {
[controller setRemoteAddress:remoteContact];
}
} else if([notification.userInfo objectForKey:@"callLog"] != nil) {
NSString *callLog = (NSString*)[notification.userInfo objectForKey:@"callLog"];
LinphoneCallLog* theLog = NULL;
const MSList * logs = linphone_core_get_call_logs([LinphoneManager getLc]);
while(logs != NULL) {
LinphoneCallLog* log = (LinphoneCallLog *) logs->data;
if([callLog isEqualToString:[NSString stringWithUTF8String:log->call_id]]) {
theLog = log;
break;
}
logs = logs->next;
}
if(theLog != NULL) {
// Go to HistoryDetails view
[[PhoneMainView instance] changeCurrentView:[HistoryViewController compositeViewDescription]];
HistoryDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[HistoryDetailsViewController compositeViewDescription] push:TRUE], HistoryDetailsViewController);
if(controller != nil) {
[controller setCallLog:theLog];
}
}
}
}

View file

@ -480,7 +480,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
notification.repeatInterval = 0;
notification.alertBody = [NSString stringWithFormat:NSLocalizedString(@"You miss %@ call", nil), address];
notification.alertAction = NSLocalizedString(@"Show", nil);
notification.userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithUTF8String:log->call_id] forKey:@"callLog"];
notification.userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithUTF8String:log->call_id] forKey:@"callLog"];
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
[notification release];
}