From 670fee6809678bb4a523536504e2cce629de80b7 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 7 May 2018 17:17:39 +0200 Subject: [PATCH] fix testers --- src/chat/chat-room/client-group-chat-room.cpp | 10 +++++++--- .../handlers/local-conference-list-event-handler.cpp | 2 +- .../handlers/remote-conference-list-event-handler.cpp | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/chat/chat-room/client-group-chat-room.cpp b/src/chat/chat-room/client-group-chat-room.cpp index cbd6abd50..93608f415 100644 --- a/src/chat/chat-room/client-group-chat-room.cpp +++ b/src/chat/chat-room/client-group-chat-room.cpp @@ -215,9 +215,13 @@ void ClientGroupChatRoomPrivate::onChatRoomCreated (const Address &remoteContact IdentityAddress addr(remoteContact); q->onConferenceCreated(addr); - if (remoteContact.hasParam("isfocus") && !q->getCore()->getPrivate()->remoteListEventHandler->findHandler(q->getChatRoomId())) { - bgTask.start(q->getCore(), 32); // It will be stopped when receiving the first notify - qConference->getPrivate()->eventHandler->subscribe(q->getChatRoomId()); + if (remoteContact.hasParam("isfocus")) { + if (q->getCore()->getPrivate()->remoteListEventHandler->findHandler(q->getChatRoomId())) { + q->getCore()->getPrivate()->remoteListEventHandler->subscribe(); + } else { + bgTask.start(q->getCore(), 32); // It will be stopped when receiving the first notify + qConference->getPrivate()->eventHandler->subscribe(q->getChatRoomId()); + } } } diff --git a/src/conference/handlers/local-conference-list-event-handler.cpp b/src/conference/handlers/local-conference-list-event-handler.cpp index c25dc0194..fec44a4ee 100644 --- a/src/conference/handlers/local-conference-list-event-handler.cpp +++ b/src/conference/handlers/local-conference-list-event-handler.cpp @@ -95,7 +95,6 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con Address addr(entry.getUri()); string notifyIdStr = addr.getUriParamValue("Last-Notify"); addr.removeUriParam("Last-Notify"); - int notifyId = notifyIdStr.empty() ? 0 : Utils::stoi(notifyIdStr); ChatRoomId chatRoomId(addr, addr); LocalConferenceEventHandler *handler = findHandler(chatRoomId); if (!handler) @@ -120,6 +119,7 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con } device->setConferenceSubscribeEvent((subscriptionState == LinphoneSubscriptionIncomingReceived) ? lev : nullptr); + int notifyId = (notifyIdStr.empty() || device->getState() == ParticipantDevice::State::Joining) ? 0 : Utils::stoi(notifyIdStr); string notifyBody = handler->getNotifyForId(notifyId, (chatRoom->getCapabilities() & AbstractChatRoom::Capabilities::OneToOne)); if (notifyBody.empty()) continue; diff --git a/src/conference/handlers/remote-conference-list-event-handler.cpp b/src/conference/handlers/remote-conference-list-event-handler.cpp index 37271b545..8a6bf33e9 100644 --- a/src/conference/handlers/remote-conference-list-event-handler.cpp +++ b/src/conference/handlers/remote-conference-list-event-handler.cpp @@ -64,8 +64,10 @@ RemoteConferenceListEventHandler::~RemoteConferenceListEventHandler () { // ----------------------------------------------------------------------------- void RemoteConferenceListEventHandler::subscribe () { - if (lev) - return; + if (lev) { + linphone_event_unref(lev); + lev = nullptr; + } if (handlers.size() == 0) return;