fix extensions

This commit is contained in:
Danmei Chen 2019-01-10 17:13:36 +01:00
parent b7d1d18d44
commit cfd0edf2f8
8 changed files with 16 additions and 13 deletions

View file

@ -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],

View file

@ -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];

View file

@ -337,7 +337,7 @@
completionHandler([self handleShortcut:shortcutItem]);
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options{
NSString *scheme = [[url scheme] lowercaseString];
if ([scheme isEqualToString:@"linphone-config"] || [scheme isEqualToString:@"linphone-config"]) {
NSString *encodedURL =

View file

@ -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];

View file

@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.org.linphone.phone.latestCallsWidget</string>
<string>group.belledonne-communications.linphone.widget</string>
</array>
</dict>
</plist>

View file

@ -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];

View file

@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.org.linphone.phone.latestChatroomsWidget</string>
<string>group.belledonne-communications.linphone.widget</string>
</array>
</dict>
</plist>

View file

@ -21,8 +21,7 @@
<key>com.apple.security.application-groups</key>
<array>
<string>group.org.linphone.phone.linphoneExtension</string>
<string>group.org.linphone.phone.latestCallsWidget</string>
<string>group.org.linphone.phone.latestChatroomsWidget</string>
<string>group.belledonne-communications.linphone.widget</string>
</array>
</dict>
</plist>