Commit 1c80966a authored by Benjamin REIS's avatar Benjamin REIS

Do not subscribe multiple times to same chatroom / ignore notify with version <= lastNotifyId

parent ca0ad937
......@@ -211,7 +211,7 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
// -----------------------------------------------------------------------------
void LocalConferenceListEventHandler::addHandler (LocalConferenceEventHandler *handler) {
if (handler)
if (handler && !findHandler(handler->getConferenceId()))
handlers.push_back(handler);
}
......
......@@ -71,8 +71,15 @@ void RemoteConferenceEventHandlerPrivate::simpleNotifyReceived (const string &xm
// 2. Update last notify.
{
auto &version = confInfo->getVersion();
if (version.present())
if (version.present()) {
unsigned int notifyVersion = version.get();
if (lastNotify >= notifyVersion) {
lWarning() << "Ignoring conference notify for: " << conferenceId << ", notify version received is: "
<< notifyVersion << ", should be stricly more than last notify id of chat-room: " << lastNotify;
return;
}
lastNotify = version.get();
}
}
bool isFullState = confInfo->getState() == StateType::full;
......
......@@ -208,7 +208,7 @@ const list<RemoteConferenceEventHandler *> &RemoteConferenceListEventHandler::ge
}
void RemoteConferenceListEventHandler::addHandler (RemoteConferenceEventHandler *handler) {
if (handler)
if (handler && !findHandler(handler->getConferenceId()))
handlers.push_back(handler);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment