From d51acdf7391a70d05186376d98b63cae95a3b8ef Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 6 Nov 2017 16:03:32 +0100 Subject: [PATCH] Some small fixes in the addresses handling for conferences. --- coreapi/linphonecore.c | 7 ++++++- src/chat/chat-room/client-group-chat-room.cpp | 9 ++++++++- src/conference/remote-conference-event-handler.cpp | 6 +----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 6a2f3dcbf..090f90641 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -7256,8 +7256,13 @@ bool_t _linphone_core_is_conference_creation (const LinphoneCore *lc, const Linp LinphoneAddress *factoryAddr = linphone_address_new(uri); if (!factoryAddr) return FALSE; - bool_t result = linphone_address_weak_equal(factoryAddr, addr); + // Do not compare ports + linphone_address_set_port(factoryAddr, 0); + LinphoneAddress *testedAddr = linphone_address_clone(addr); + linphone_address_set_port(testedAddr, 0); + bool_t result = linphone_address_weak_equal(factoryAddr, testedAddr); linphone_address_unref(factoryAddr); + linphone_address_unref(testedAddr); return result; } diff --git a/src/chat/chat-room/client-group-chat-room.cpp b/src/chat/chat-room/client-group-chat-room.cpp index 29b77d680..a850e6c57 100644 --- a/src/chat/chat-room/client-group-chat-room.cpp +++ b/src/chat/chat-room/client-group-chat-room.cpp @@ -320,7 +320,11 @@ void ClientGroupChatRoom::onParticipantSetAdmin (shared_ptrgetPrivate()->setAdmin(event->getType() == EventLog::Type::ConferenceParticipantSetAdmin); + bool isAdmin = event->getType() == EventLog::Type::ConferenceParticipantSetAdmin; + if (participant->isAdmin() == isAdmin) + return; // No change in the local admin status, do not notify + participant->getPrivate()->setAdmin(isAdmin); + LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this); LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr); LinphoneChatRoomCbsParticipantAdminStatusChangedCb cb = linphone_chat_room_cbs_get_participant_admin_status_changed(cbs); @@ -331,7 +335,10 @@ void ClientGroupChatRoom::onParticipantSetAdmin (shared_ptr event) { + if (getSubject() == event->getSubject()) + return; // No change in the local subject, do not notify RemoteConference::setSubject(event->getSubject()); + LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this); LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr); LinphoneChatRoomCbsSubjectChangedCb cb = linphone_chat_room_cbs_get_subject_changed(cbs); diff --git a/src/conference/remote-conference-event-handler.cpp b/src/conference/remote-conference-event-handler.cpp index 180d7e27b..1c768441d 100644 --- a/src/conference/remote-conference-event-handler.cpp +++ b/src/conference/remote-conference-event-handler.cpp @@ -80,15 +80,11 @@ void RemoteConferenceEventHandler::notifyReceived (const string &xmlBody) { bool isFullState = (confInfo->getState() == StateType::full); Address cleanedConfAddress = d->confAddress; cleanedConfAddress.clean(); - cleanedConfAddress.setPort(0); // Temporary workaround Address entityAddress(confInfo->getEntity().c_str()); Address cleanedConfAddress2(cleanedConfAddress); cleanedConfAddress2.setDomain(entityAddress.getDomain()); - if ( - confInfo->getEntity() == cleanedConfAddress.asString() || - confInfo->getEntity() == cleanedConfAddress2.asString() - ) { + if (entityAddress.weakEqual(cleanedConfAddress) || entityAddress.weakEqual(cleanedConfAddress2)) { if ( confInfo->getConferenceDescription().present() && confInfo->getConferenceDescription().get().getSubject().present()