diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index 1b84a20a4..b0fcadb58 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -240,8 +240,8 @@ static UICompositeViewDescription *compositeDescription = nil; linphone_chat_message_unref(msg); [_tableController scrollToBottom:true]; - - if(linphone_core_lime_enabled(LC) == LinphoneLimeMandatory && !linphone_chat_room_lime_available(_chatRoom)) { + + if (linphone_core_lime_enabled(LC) == LinphoneLimeMandatory && !linphone_chat_room_lime_available(_chatRoom)) { [LinphoneManager.instance alertLIME:_chatRoom]; } diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 56fd9ab28..d6e6594a6 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -707,8 +707,8 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response if (room) { LinphoneChatMessage *msg = linphone_chat_room_create_message(room, replyText.UTF8String); linphone_chat_room_send_chat_message(room, msg); - - if(linphone_core_lime_enabled(LC) == LinphoneLimeMandatory && !linphone_chat_room_lime_available(room)) { + + if (linphone_core_lime_enabled(LC) == LinphoneLimeMandatory && !linphone_chat_room_lime_available(room)) { [LinphoneManager.instance alertLIME:room]; } linphone_chat_room_mark_as_read(room); @@ -754,7 +754,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response linphone_call_set_authentication_token_verified(call, NO); } } else if ([response.actionIdentifier isEqual:@"Call"]) { - + } else { // in this case the value is : com.apple.UNNotificationDefaultActionIdentifier if ([response.notification.request.content.categoryIdentifier isEqual:@"call_cat"]) { [PhoneMainView.instance displayIncomingCall:call]; @@ -903,11 +903,11 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response if (room) { LinphoneChatMessage *msg = linphone_chat_room_create_message(room, replyText.UTF8String); linphone_chat_room_send_chat_message(room, msg); - - if(linphone_core_lime_enabled(LC) == LinphoneLimeMandatory && !linphone_chat_room_lime_available(room)) { + + if (linphone_core_lime_enabled(LC) == LinphoneLimeMandatory && !linphone_chat_room_lime_available(room)) { [LinphoneManager.instance alertLIME:room]; } - + linphone_chat_room_mark_as_read(room); [PhoneMainView.instance updateApplicationBadgeNumber]; } diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index dbd914ca4..190938e99 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -323,7 +323,7 @@ [self setBool:[lm lpConfigBoolForKey:@"repeat_call_notification"] forKey:@"repeat_call_notification_preference"]; } - + // chat section { [self setInteger:linphone_core_lime_enabled(LC) forKey:@"use_lime_preference"]; @@ -747,28 +747,32 @@ [lm lpConfigSetBool:[self boolForKey:@"repeat_call_notification_preference"] forKey:@"repeat_call_notification"]; } - + // chat section { int val = [self integerForKey:@"use_lime_preference"]; linphone_core_enable_lime(LC, val); - if(val == LinphoneLimeMandatory && (linphone_core_get_media_encryption(LC) != LinphoneMediaEncryptionZRTP)) { + if (val == LinphoneLimeMandatory && + (linphone_core_get_media_encryption(LC) != LinphoneMediaEncryptionZRTP)) { linphone_core_set_media_encryption(LC, LinphoneMediaEncryptionZRTP); [self setCString:"ZRTP" forKey:@"media_encryption_preference"]; - UIAlertController *errView = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"ZRTP activation", nil) - message:NSLocalizedString(@"LIME requires ZRTP encryption.\n" - @"By activating LIME you automatically ZRTP media encryption.", - nil) - preferredStyle:UIAlertControllerStyleAlert]; - - UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" + UIAlertController *errView = [UIAlertController + alertControllerWithTitle:NSLocalizedString(@"ZRTP activation", nil) + message:NSLocalizedString( + @"LIME requires ZRTP encryption.\n" + @"By activating LIME you automatically ZRTP media encryption.", + nil) + preferredStyle:UIAlertControllerStyleAlert]; + + UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) {}]; + handler:^(UIAlertAction *action){ + }]; [errView addAction:defaultAction]; [PhoneMainView.instance presentViewController:errView animated:YES completion:nil]; } linphone_core_set_file_transfer_server( - LC, [[self stringForKey:@"file_transfer_server_url_preference"] UTF8String]); + LC, [[self stringForKey:@"file_transfer_server_url_preference"] UTF8String]); } // network section diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index eb48a0452..614dddc5d 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -140,7 +140,7 @@ typedef struct _LinphoneManagerSounds { - (void)acceptCallForCallId:(NSString*)callid; - (LinphoneCall *)callByCallId:(NSString *)call_id; - (void)cancelLocalNotifTimerForCallId:(NSString*)callid; -- (void) alertLIME:(LinphoneChatRoom *)room; +- (void)alertLIME:(LinphoneChatRoom *)room; + (BOOL)langageDirectionIsRTL; + (void)kickOffNetworkConnection; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 1ee361e56..1fc516ee6 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1360,28 +1360,30 @@ static void linphone_iphone_call_encryption_changed(LinphoneCore *lc, LinphoneCa } #pragma mark - Message composition start -- (void) alertLIME:(LinphoneChatRoom *)room { - UIAlertController *errView = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"LIME Error", nil) - message:NSLocalizedString(@"You are trying to send a message using LIME to a contact not verified by ZRTP.\n" - @"Please call this contact and verify his ZRTP key before sending your messages.", - nil) - preferredStyle:UIAlertControllerStyleAlert]; - - UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" +- (void)alertLIME:(LinphoneChatRoom *)room { + UIAlertController *errView = [UIAlertController + alertControllerWithTitle:NSLocalizedString(@"LIME Error", nil) + message:NSLocalizedString( + @"You are trying to send a message using LIME to a contact not verified by ZRTP.\n" + @"Please call this contact and verify his ZRTP key before sending your messages.", + nil) + preferredStyle:UIAlertControllerStyleAlert]; + + UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) {}]; + handler:^(UIAlertAction *action){ + }]; [errView addAction:defaultAction]; - - UIAlertAction* callAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Call", nil) + + UIAlertAction *callAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Call", nil) style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) { - [self call:linphone_chat_room_get_peer_address(room)]; - }]; + handler:^(UIAlertAction *action) { + [self call:linphone_chat_room_get_peer_address(room)]; + }]; [errView addAction:callAction]; [PhoneMainView.instance presentViewController:errView animated:YES completion:nil]; } - - (void)onMessageComposeReceived:(LinphoneCore *)core forRoom:(LinphoneChatRoom *)room { [NSNotificationCenter.defaultCenter postNotificationName:kLinphoneTextComposeEvent object:self diff --git a/Classes/SettingsView.m b/Classes/SettingsView.m index e658f782d..6ffe304d4 100644 --- a/Classes/SettingsView.m +++ b/Classes/SettingsView.m @@ -593,8 +593,8 @@ void update_hash_cbs(LinphoneAccountCreator *creator, LinphoneAccountCreatorStat if (!linphone_core_sip_transport_supported(LC, LinphoneTransportTls)) { [hiddenKeys addObject:@"media_encryption_preference"]; } - - if(!linphone_core_lime_available(LC)) { + + if (!linphone_core_lime_available(LC)) { [hiddenKeys addObject:@"use_lime_preference"]; } diff --git a/Classes/Utils/FileTransferDelegate.m b/Classes/Utils/FileTransferDelegate.m index ddd22a714..be9a9da89 100644 --- a/Classes/Utils/FileTransferDelegate.m +++ b/Classes/Utils/FileTransferDelegate.m @@ -7,9 +7,9 @@ // #import "FileTransferDelegate.h" -#import "Utils.h" -#import "PhoneMainView.h" #import "LinphoneManager.h" +#import "PhoneMainView.h" +#import "Utils.h" @interface FileTransferDelegate () @property(strong) NSMutableData *data; @@ -173,11 +173,10 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m LOGI(@"%p Uploading content from message %p", self, _message); linphone_chat_room_send_chat_message(chatRoom, _message); - - if(linphone_core_lime_enabled(LC) == LinphoneLimeMandatory && !linphone_chat_room_lime_available(chatRoom)) { + + if (linphone_core_lime_enabled(LC) == LinphoneLimeMandatory && !linphone_chat_room_lime_available(chatRoom)) { [LinphoneManager.instance alertLIME:chatRoom]; } - } - (BOOL)download:(LinphoneChatMessage *)message {