diff --git a/src/conference/local-conference-event-handler-p.h b/src/conference/local-conference-event-handler-p.h index 53c2761eb..16ee8c9f1 100644 --- a/src/conference/local-conference-event-handler-p.h +++ b/src/conference/local-conference-event-handler-p.h @@ -29,10 +29,11 @@ LINPHONE_BEGIN_NAMESPACE class Participant; +class ParticipantDevice; class LocalConferenceEventHandlerPrivate : public ObjectPrivate { public: - void notifyFullState (const std::string ¬ify, const std::shared_ptr &participant); + void notifyFullState (const std::string ¬ify, const std::shared_ptr &device); void notifyAllExcept (const std::string ¬ify, const std::shared_ptr &exceptParticipant); void notifyAll (const std::string ¬ify); std::string createNotifyFullState (int notifyId = -1); @@ -52,6 +53,7 @@ private: std::string createNotify (Xsd::ConferenceInfo::ConferenceType confInfo, int notifyId = -1, bool isFullState = false); void notifyParticipant (const std::string ¬ify, const std::shared_ptr &participant); + void notifyParticipantDevice (const std::string ¬ify, const std::shared_ptr &device); L_DECLARE_PUBLIC(LocalConferenceEventHandler); }; diff --git a/src/conference/local-conference-event-handler.cpp b/src/conference/local-conference-event-handler.cpp index c9854e1f4..75f2fd85d 100644 --- a/src/conference/local-conference-event-handler.cpp +++ b/src/conference/local-conference-event-handler.cpp @@ -37,8 +37,8 @@ using namespace Xsd::ConferenceInfo; // ----------------------------------------------------------------------------- -void LocalConferenceEventHandlerPrivate::notifyFullState (const string ¬ify, const shared_ptr &participant) { - notifyParticipant(notify, participant); +void LocalConferenceEventHandlerPrivate::notifyFullState (const string ¬ify, const shared_ptr &device) { + notifyParticipantDevice(notify, device); } void LocalConferenceEventHandlerPrivate::notifyAllExcept (const string ¬ify, const shared_ptr &exceptParticipant) { @@ -54,14 +54,17 @@ void LocalConferenceEventHandlerPrivate::notifyAll (const string ¬ify) { } void LocalConferenceEventHandlerPrivate::notifyParticipant (const string ¬ify, const shared_ptr &participant) { - for (const auto &device : participant->getPrivate()->getDevices()) { - if (device->isSubscribedToConferenceEventPackage()) { - LinphoneEvent *ev = device->getConferenceSubscribeEvent(); - LinphoneContent *content = linphone_core_create_content(ev->lc); - linphone_content_set_buffer(content, (const uint8_t *)notify.c_str(), strlen(notify.c_str())); - linphone_event_notify(ev, content); - linphone_content_unref(content); - } + for (const auto &device : participant->getPrivate()->getDevices()) + notifyParticipantDevice(notify, device); +} + +void LocalConferenceEventHandlerPrivate::notifyParticipantDevice (const string ¬ify, const shared_ptr &device) { + if (device->isSubscribedToConferenceEventPackage()) { + LinphoneEvent *ev = device->getConferenceSubscribeEvent(); + LinphoneContent *content = linphone_core_create_content(ev->lc); + linphone_content_set_buffer(content, (const uint8_t *)notify.c_str(), strlen(notify.c_str())); + linphone_event_notify(ev, content); + linphone_content_unref(content); } } @@ -280,9 +283,9 @@ void LocalConferenceEventHandler::subscribeReceived (LinphoneEvent *lev) { if (linphone_event_get_subscription_state(lev) == LinphoneSubscriptionActive) { unsigned int lastNotify = static_cast(Utils::stoi(linphone_event_get_custom_header(lev, "Last-Notify-Version"))); if (lastNotify == 0) { - lInfo() << "Sending initial notify of conference:" << d->conf->getConferenceAddress().asStringUriOnly() << " to: " << participant->getAddress().asString(); + lInfo() << "Sending initial notify of conference:" << d->conf->getConferenceAddress().asStringUriOnly() << " to: " << device->getGruu().asString(); device->setConferenceSubscribeEvent(lev); - d->notifyFullState(d->createNotifyFullState(), participant); + d->notifyFullState(d->createNotifyFullState(), device); } else if (lastNotify < d->lastNotify) { lInfo() << "Sending all missed notify for conference:" << d->conf->getConferenceAddress().asStringUriOnly() << " from: " << lastNotify << " to: " << participant->getAddress().asString();