From 79e9f274e9e6c7c86dbac80714eaaee7cd3e09d7 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 5 Dec 2017 10:26:35 +0100 Subject: [PATCH] Change from chatroom_instatiated to state changed --- Classes/LinphoneManager.m | 10 +++++----- submodules/linphone | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 7a28117bc..9fa6c114d 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1400,8 +1400,9 @@ static void linphone_iphone_call_encryption_changed(LinphoneCore *lc, LinphoneCa [NSNotificationCenter.defaultCenter postNotificationName:kLinphoneCallEncryptionChanged object:self userInfo:dict]; } -void linphone_iphone_chatroom_instantiated(LinphoneCore *lc, LinphoneChatRoom *cr) { - [NSNotificationCenter.defaultCenter postNotificationName:kLinphoneMessageReceived object:nil]; +void linphone_iphone_chatroom_state_changed(LinphoneCore *lc, LinphoneChatRoom *cr, LinphoneChatRoomState state) { + if (state == LinphoneChatRoomStateCreated) + [NSNotificationCenter.defaultCenter postNotificationName:kLinphoneMessageReceived object:nil]; } #pragma mark - Message composition start @@ -1418,8 +1419,7 @@ void linphone_iphone_chatroom_instantiated(LinphoneCore *lc, LinphoneChatRoom *c UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault - handler:^(UIAlertAction *action){ - }]; + handler:^(UIAlertAction *action){}]; [errView addAction:defaultAction]; UIAlertAction *callAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Call", nil) @@ -1967,7 +1967,7 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat linphone_core_cbs_set_global_state_changed(cbs, linphone_iphone_global_state_changed); linphone_core_cbs_set_notify_received(cbs, linphone_iphone_notify_received); linphone_core_cbs_set_call_encryption_changed(cbs, linphone_iphone_call_encryption_changed); - linphone_core_cbs_set_chat_room_instantiated(cbs, linphone_iphone_chatroom_instantiated); + linphone_core_cbs_set_chat_room_state_changed(cbs, linphone_iphone_chatroom_state_changed); linphone_core_cbs_set_user_data(cbs, (__bridge void *)(self)); theLinphoneCore = linphone_factory_create_core_with_config(factory, cbs, _configDb); diff --git a/submodules/linphone b/submodules/linphone index 8783aca2d..2c9dfd6ca 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 8783aca2db07286c1033b4b6d233ea0e3527ce5d +Subproject commit 2c9dfd6ca82191a977a1690a66ad3409b6439731