From e287fd6580c7010ef5f5586b5106cc086ab1ba55 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Mon, 6 Jan 2020 09:13:16 +0100 Subject: [PATCH] remove useless functions --- Classes/ChatConversationView.m | 4 -- Classes/LinphoneManager.h | 1 - Classes/LinphoneManager.m | 56 ---------------------------- Classes/Utils/FileTransferDelegate.m | 4 -- 4 files changed, 65 deletions(-) diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index afdf1ecfa..e0a577f28 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -380,10 +380,6 @@ static UICompositeViewDescription *compositeDescription = nil; // we must ref & unref message because in case of error, it will be destroy otherwise linphone_chat_message_send(msg); - if (linphone_core_lime_x3dh_enabled(LC) && !linphone_chat_room_lime_available(_chatRoom)) { - [LinphoneManager.instance alertLIME:_chatRoom]; - } - return TRUE; } diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index dcc6a8eb4..af065a3bb 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -134,7 +134,6 @@ typedef struct _LinphoneManagerSounds { - (void)acceptCallForCallId:(NSString*)callid; - (LinphoneCall *)callByCallId:(NSString *)call_id; - (void)cancelLocalNotifTimerForCallId:(NSString*)callid; -- (void)alertLIME:(LinphoneChatRoom *)room; - (void)startPushLongRunningTask:(NSString *)loc_key callId:(NSString *)callId; + (BOOL)langageDirectionIsRTL; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 806afe63e..55efddb3a 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1489,59 +1489,6 @@ void linphone_iphone_qr_code_found(LinphoneCore *lc, const char *result) { } #pragma mark - Message composition start -- (void)alertLIME:(LinphoneChatRoom *)room { - NSString *title = NSLocalizedString(@"LIME warning", nil); - NSString *body = - 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); - - if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) { - UIAlertController *errView = - [UIAlertController alertControllerWithTitle:title message:body preferredStyle:UIAlertControllerStyleAlert]; - - UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK" - style:UIAlertActionStyleDefault - handler:^(UIAlertAction *action){}]; - [errView addAction:defaultAction]; - - UIAlertAction *callAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Call", nil) - style:UIAlertActionStyleDefault - handler:^(UIAlertAction *action) { - [self call:linphone_chat_room_get_peer_address(room)]; - }]; - [errView addAction:callAction]; - [PhoneMainView.instance presentViewController:errView animated:YES completion:nil]; - } else { - if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max) { - UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init]; - content.title = title; - content.body = body; - content.categoryIdentifier = @"lime"; - - UNNotificationRequest *req = [UNNotificationRequest - requestWithIdentifier:@"lime_request" - content:content - trigger:[UNTimeIntervalNotificationTrigger triggerWithTimeInterval:1 repeats:NO]]; - [[UNUserNotificationCenter currentNotificationCenter] - addNotificationRequest:req - withCompletionHandler:^(NSError *_Nullable error) { - // Enable or disable features based on authorization. - if (error) { - LOGD(@"Error while adding notification request :"); - LOGD(error.description); - } - }]; - } else { - UILocalNotification *notification = [[UILocalNotification alloc] init]; - notification.repeatInterval = 0; - notification.alertTitle = title; - notification.alertBody = body; - [[UIApplication sharedApplication] presentLocalNotificationNow:notification]; - } - } -} - - (void)onMessageComposeReceived:(LinphoneCore *)core forRoom:(LinphoneChatRoom *)room { [NSNotificationCenter.defaultCenter postNotificationName:kLinphoneTextComposeEvent object:self @@ -2439,9 +2386,6 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { LinphoneChatMessage *msg = linphone_chat_room_create_message(room, replyText.UTF8String); linphone_chat_message_send(msg); - if (linphone_core_lime_x3dh_enabled(LC) && !linphone_chat_room_lime_available(room)) - [LinphoneManager.instance alertLIME:room]; - [ChatConversationView markAsRead:room]; } diff --git a/Classes/Utils/FileTransferDelegate.m b/Classes/Utils/FileTransferDelegate.m index acc1faf2b..3a69a451e 100644 --- a/Classes/Utils/FileTransferDelegate.m +++ b/Classes/Utils/FileTransferDelegate.m @@ -290,10 +290,6 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m LOGI(@"%p Uploading content from message %p", self, _message); linphone_chat_message_send(_message); - - if (linphone_core_lime_x3dh_enabled(LC) && !linphone_chat_room_lime_available(chatRoom)) { - [LinphoneManager.instance alertLIME:chatRoom]; - } } - (void)upload:(UIImage *)image withassetId:(NSString *)phAssetId forChatRoom:(LinphoneChatRoom *)chatRoom withQuality:(float)quality {