diff --git a/src/conference/handlers/local-conference-event-handler.cpp b/src/conference/handlers/local-conference-event-handler.cpp index 32055a7cd..3ee3eb4cc 100644 --- a/src/conference/handlers/local-conference-event-handler.cpp +++ b/src/conference/handlers/local-conference-event-handler.cpp @@ -532,10 +532,10 @@ ChatRoomId LocalConferenceEventHandler::getChatRoomId () const { return d->chatRoomId; } -string LocalConferenceEventHandler::getNotifyForId (int notifyId) { +string LocalConferenceEventHandler::getNotifyForId (int notifyId, bool oneToOne) { L_D(); if (notifyId == 0) - return d->createNotifyFullState(static_cast(d->lastNotify)); // oneToOne ? + return d->createNotifyFullState(static_cast(d->lastNotify), oneToOne); else if (notifyId < static_cast(d->lastNotify)) return d->createNotifyMultipart(notifyId); diff --git a/src/conference/handlers/local-conference-event-handler.h b/src/conference/handlers/local-conference-event-handler.h index 7d954d892..6f8a5cc3c 100644 --- a/src/conference/handlers/local-conference-event-handler.h +++ b/src/conference/handlers/local-conference-event-handler.h @@ -54,7 +54,7 @@ public: void setChatRoomId (const ChatRoomId &chatRoomId); ChatRoomId getChatRoomId () const; - std::string getNotifyForId (int notifyId); + std::string getNotifyForId (int notifyId, bool oneToOne = false); private: L_DECLARE_PRIVATE(LocalConferenceEventHandler); diff --git a/src/conference/handlers/local-conference-list-event-handler.cpp b/src/conference/handlers/local-conference-list-event-handler.cpp index bdf61c7d2..8cadb363c 100644 --- a/src/conference/handlers/local-conference-list-event-handler.cpp +++ b/src/conference/handlers/local-conference-list-event-handler.cpp @@ -18,6 +18,7 @@ */ #include "belle-sip/utils.h" +#include "linphone/enums/chat-room-enums.h" #include "linphone/utils/utils.h" #include "linphone/api/c-address.h" @@ -97,15 +98,16 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con if (!handler) continue; - string notifyBody = handler->getNotifyForId(notifyId); - if (notifyBody.empty()) - continue; - shared_ptr chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(linphone_event_get_core(lev))->findChatRoom(chatRoomId); if (!chatRoom) { lError() << "Received subscribe for unknown chat room: " << chatRoomId; continue; } + + string notifyBody = handler->getNotifyForId(notifyId, (chatRoom->getCapabilities() & AbstractChatRoom::Capabilities::OneToOne)); + if (notifyBody.empty()) + continue; + shared_ptr participant = chatRoom->findParticipant(participantAddr); if (!participant) { lError() << "Received subscribe for unknown participant: " << participantAddr << " for chat room: " << chatRoomId;