get notify body for each entry of the subscribe

This commit is contained in:
Benjamin Reis 2018-03-16 20:08:08 +01:00
parent 040ecf2448
commit ca7dd265fc
3 changed files with 15 additions and 2 deletions

View file

@ -529,5 +529,14 @@ ChatRoomId LocalConferenceEventHandler::getChatRoomId () const {
return d->chatRoomId;
}
string LocalConferenceEventHandler::getNotifyForId (int notifyId) {
L_D();
if (notifyId == 0)
return d->createNotifyFullState(static_cast<int>(d->lastNotify)); // oneToOne ?
else if (notifyId < static_cast<int>(d->lastNotify))
return d->createNotifyMultipart(notifyId);
return Utils::getEmptyConstRefObject<string>();
}
LINPHONE_END_NAMESPACE

View file

@ -38,6 +38,7 @@ class LocalConference;
class LocalConferenceEventHandlerPrivate;
class LocalConferenceEventHandler : public Object {
friend class LocalConferenceListEventHandler;
public:
LocalConferenceEventHandler (LocalConference *localConference, unsigned int notify = 0);
@ -53,7 +54,7 @@ public:
void setChatRoomId (const ChatRoomId &chatRoomId);
ChatRoomId getChatRoomId () const;
void getNotifyForId (int notifyId) const {};
std::string getNotifyForId (int notifyId);
private:
L_DECLARE_PRIVATE(LocalConferenceEventHandler);

View file

@ -49,7 +49,10 @@ void LocalConferenceListEventHandler::subscribeReceived (const string &xmlBody)
if (!handler)
continue;
handler->getNotifyForId(notifyId);
string notifyBody = handler->getNotifyForId(notifyId);
if (notifyBody.empty())
continue;
}
}
}