diff --git a/Classes/ChatsListTableView.m b/Classes/ChatsListTableView.m index 60c69d715..a9f88c771 100644 --- a/Classes/ChatsListTableView.m +++ b/Classes/ChatsListTableView.m @@ -124,7 +124,7 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo } + (void) saveDataToUserDefaults { - NSUserDefaults *defaults = [[NSUserDefaults alloc] initWithSuiteName:[NSString stringWithFormat:@"group.%@.latestChatroomsWidget",[[NSBundle mainBundle] bundleIdentifier]]]; + NSUserDefaults *defaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.belledonne-communications.linphone.widget"]; MSList *sorted = nil; const MSList *unsorted = linphone_core_get_chat_rooms(LC); const MSList *iter = unsorted; @@ -152,19 +152,23 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo forKey:@"peer"]; [dict setObject:[NSString stringWithUTF8String:linphone_address_as_string_uri_only(local_address)] forKey:@"local"]; - if (linphone_chat_room_get_conference_address(cr)) { + LinphoneChatRoomCapabilitiesMask capabilities = linphone_chat_room_get_capabilities(cr); + if (!(capabilities & LinphoneChatRoomCapabilitiesOneToOne)) { if (!linphone_chat_room_get_subject(cr)) { sorted = sorted->next; continue; } display = [NSString stringWithUTF8String:linphone_chat_room_get_subject(cr)]; } else { - if (!linphone_address_get_username(peer_address)) { + bctbx_list_t *participants = linphone_chat_room_get_participants(cr); + LinphoneParticipant *firstParticipant = participants ? (LinphoneParticipant *)participants->data : NULL; + const LinphoneAddress *addr = firstParticipant ? linphone_participant_get_address(firstParticipant) : linphone_chat_room_get_peer_address(cr); + if (!linphone_address_get_username(addr)) { sorted = sorted->next; continue; } - display = [NSString stringWithUTF8String:linphone_address_get_display_name(peer_address)?:linphone_address_get_username(peer_address)]; - if ([FastAddressBook imageForAddress:peer_address]) + display = [NSString stringWithUTF8String:linphone_address_get_display_name(addr)?:linphone_address_get_username(addr)]; + if ([FastAddressBook imageForAddress:addr]) [dict setObject:UIImageJPEGRepresentation([UIImage resizeImage:[FastAddressBook imageForAddress:peer_address] withMaxWidth:200 andMaxHeight:200], diff --git a/Classes/HistoryListTableView.m b/Classes/HistoryListTableView.m index 9d82b367d..4961d6b21 100644 --- a/Classes/HistoryListTableView.m +++ b/Classes/HistoryListTableView.m @@ -169,7 +169,7 @@ + (void) saveDataToUserDefaults { const bctbx_list_t *logs = linphone_core_get_call_logs(LC); - NSUserDefaults *mySharedDefaults = [[NSUserDefaults alloc] initWithSuiteName: [NSString stringWithFormat:@"group.%@.latestCallsWidget",[[NSBundle mainBundle] bundleIdentifier]]]; + NSUserDefaults *mySharedDefaults = [[NSUserDefaults alloc] initWithSuiteName: @"group.belledonne-communications.linphone.widget"]; NSMutableArray *logsShare = [NSMutableArray array]; NSMutableDictionary *tmpStoreDict = [NSMutableDictionary dictionary]; NSMutableArray *addedContacts = [NSMutableArray array]; diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index ff8aee3ab..3abfa89b2 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -337,7 +337,7 @@ completionHandler([self handleShortcut:shortcutItem]); } -- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options{ NSString *scheme = [[url scheme] lowercaseString]; if ([scheme isEqualToString:@"linphone-config"] || [scheme isEqualToString:@"linphone-config"]) { NSString *encodedURL = diff --git a/latestCallsWidget/TodayViewController.m b/latestCallsWidget/TodayViewController.m index 15ae1c44d..7b5400081 100644 --- a/latestCallsWidget/TodayViewController.m +++ b/latestCallsWidget/TodayViewController.m @@ -15,7 +15,7 @@ @implementation TodayViewController - (void)loadData { - NSUserDefaults *mySharedDefaults = [[NSUserDefaults alloc] initWithSuiteName: [NSString stringWithFormat:@"group.%@",[[NSBundle mainBundle] bundleIdentifier]]]; + NSUserDefaults *mySharedDefaults = [[NSUserDefaults alloc] initWithSuiteName: @"group.belledonne-communications.linphone.widget"]; [_imgs removeAllObjects]; [_logIds removeAllObjects]; [_displayNames removeAllObjects]; diff --git a/latestCallsWidget/latestCallsWidget.entitlements b/latestCallsWidget/latestCallsWidget.entitlements index 32a4526df..eae1fdc31 100644 --- a/latestCallsWidget/latestCallsWidget.entitlements +++ b/latestCallsWidget/latestCallsWidget.entitlements @@ -4,7 +4,7 @@ com.apple.security.application-groups - group.org.linphone.phone.latestCallsWidget + group.belledonne-communications.linphone.widget diff --git a/latestChatroomsWidget/TodayViewController.m b/latestChatroomsWidget/TodayViewController.m index 61320f0f6..4686acab0 100644 --- a/latestChatroomsWidget/TodayViewController.m +++ b/latestChatroomsWidget/TodayViewController.m @@ -15,7 +15,7 @@ @implementation TodayViewController - (void)loadData { - NSUserDefaults *mySharedDefaults = [[NSUserDefaults alloc] initWithSuiteName: [NSString stringWithFormat:@"group.%@",[[NSBundle mainBundle] bundleIdentifier]]]; + NSUserDefaults *mySharedDefaults = [[NSUserDefaults alloc] initWithSuiteName: @"group.belledonne-communications.linphone.widget"]; [_imgs removeAllObjects]; [_addresses removeAllObjects]; [_localAddress removeAllObjects]; diff --git a/latestChatroomsWidget/latestChatroomsWidget.entitlements b/latestChatroomsWidget/latestChatroomsWidget.entitlements index 9b423f327..eae1fdc31 100644 --- a/latestChatroomsWidget/latestChatroomsWidget.entitlements +++ b/latestChatroomsWidget/latestChatroomsWidget.entitlements @@ -4,7 +4,7 @@ com.apple.security.application-groups - group.org.linphone.phone.latestChatroomsWidget + group.belledonne-communications.linphone.widget diff --git a/linphone.entitlements b/linphone.entitlements index 5df6178aa..afde86dcc 100644 --- a/linphone.entitlements +++ b/linphone.entitlements @@ -21,8 +21,7 @@ com.apple.security.application-groups group.org.linphone.phone.linphoneExtension - group.org.linphone.phone.latestCallsWidget - group.org.linphone.phone.latestChatroomsWidget + group.belledonne-communications.linphone.widget