From da23396b6e443fed7f72aa0185a141d45ea26870 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 3 Oct 2017 10:48:14 +0200 Subject: [PATCH] add subject handling to xml conference description --- .../local-conference-event-handler.cpp | 16 ++++++++++++++++ .../remote-conference-event-handler.cpp | 3 +++ 2 files changed, 19 insertions(+) diff --git a/src/conference/local-conference-event-handler.cpp b/src/conference/local-conference-event-handler.cpp index dd7734a47..7e99bf8c7 100644 --- a/src/conference/local-conference-event-handler.cpp +++ b/src/conference/local-conference-event-handler.cpp @@ -90,9 +90,13 @@ void LocalConferenceEventHandlerPrivate::notifyAll(string notify) { string LocalConferenceEventHandlerPrivate::createNotifyFullState() { string entity = this->conf->getConferenceAddress()->asStringUriOnly(); + string subject = this->conf->getSubject(); ConferenceType confInfo = ConferenceType(entity); UsersType users; + ConferenceDescriptionType confDescr = ConferenceDescriptionType(); + confDescr.setSubject(subject); confInfo.setUsers(users); + confInfo.setConferenceDescription((const ConferenceDescriptionType) confDescr); for (const auto &participant : this->conf->getParticipants()) { UserType user = UserType(); @@ -109,9 +113,13 @@ string LocalConferenceEventHandlerPrivate::createNotifyFullState() { string LocalConferenceEventHandlerPrivate::createNotifyParticipantAdded(const Address &addr) { string entity = this->conf->getConferenceAddress()->asStringUriOnly(); + string subject = this->conf->getSubject(); ConferenceType confInfo = ConferenceType(entity); UsersType users; + ConferenceDescriptionType confDescr = ConferenceDescriptionType(); + confDescr.setSubject(subject); confInfo.setUsers(users); + confInfo.setConferenceDescription((const ConferenceDescriptionType)confDescr); UserType user = UserType(); UserRolesType roles; @@ -126,9 +134,13 @@ string LocalConferenceEventHandlerPrivate::createNotifyParticipantAdded(const Ad string LocalConferenceEventHandlerPrivate::createNotifyParticipantRemoved(const Address &addr) { string entity = this->conf->getConferenceAddress()->asStringUriOnly(); + string subject = this->conf->getSubject(); ConferenceType confInfo = ConferenceType(entity); UsersType users; + ConferenceDescriptionType confDescr = ConferenceDescriptionType(); + confDescr.setSubject(subject); confInfo.setUsers(users); + confInfo.setConferenceDescription((const ConferenceDescriptionType)confDescr); UserType user = UserType(); user.setEntity(addr.asStringUriOnly()); @@ -140,9 +152,13 @@ string LocalConferenceEventHandlerPrivate::createNotifyParticipantRemoved(const string LocalConferenceEventHandlerPrivate::createNotifyParticipantAdmined(const Address &addr, bool isAdmin) { string entity = this->conf->getConferenceAddress()->asStringUriOnly(); + string subject = this->conf->getSubject(); ConferenceType confInfo = ConferenceType(entity); UsersType users; + ConferenceDescriptionType confDescr = ConferenceDescriptionType(); + confDescr.setSubject(subject); confInfo.setUsers(users); + confInfo.setConferenceDescription((const ConferenceDescriptionType)confDescr); UserType user = UserType(); UserRolesType roles; diff --git a/src/conference/remote-conference-event-handler.cpp b/src/conference/remote-conference-event-handler.cpp index 2acc7bbee..19d45c51e 100644 --- a/src/conference/remote-conference-event-handler.cpp +++ b/src/conference/remote-conference-event-handler.cpp @@ -83,6 +83,9 @@ void RemoteConferenceEventHandler::notifyReceived(string xmlBody) { Address cleanedConfAddress = d->confAddress; cleanedConfAddress.setPort(0); if (confInfo->getEntity() == cleanedConfAddress.asString()) { + if(confInfo->getConferenceDescription().present() && confInfo->getConferenceDescription().get().getSubject().present()) + d->listener->onSubjectChanged(confInfo->getConferenceDescription().get().getSubject().get()); + for (const auto &user : confInfo->getUsers()->getUser()) { LinphoneAddress *cAddr = linphone_core_interpret_url(d->core, user.getEntity()->c_str()); char *cAddrStr = linphone_address_as_string(cAddr);