From a1fe2223f09605c891d5d0fbf6d5e723c8fe9fbb Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 13 Oct 2017 10:33:36 +0200 Subject: [PATCH] fix & test last notify id in conference event package --- src/conference/local-conference-event-handler.cpp | 7 +++---- tester/conference-event-tester.cpp | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/conference/local-conference-event-handler.cpp b/src/conference/local-conference-event-handler.cpp index ff9b33167..42d75d19d 100644 --- a/src/conference/local-conference-event-handler.cpp +++ b/src/conference/local-conference-event-handler.cpp @@ -66,10 +66,9 @@ void LocalConferenceEventHandlerPrivate::notifyAll (const string ¬ify) { } string LocalConferenceEventHandlerPrivate::createNotify (ConferenceType confInfo) { - if (confInfo.getVersion().present()) { - lastNotify = confInfo.getVersion().get() + 1; - confInfo.setVersion(lastNotify); - } + lastNotify = lastNotify + 1; + confInfo.setVersion(lastNotify); + stringstream notify; Xsd::XmlSchema::NamespaceInfomap map; map[""].name = "urn:ietf:params:xml:ns:conference-info"; diff --git a/tester/conference-event-tester.cpp b/tester/conference-event-tester.cpp index 3c4876e6c..72b78453b 100644 --- a/tester/conference-event-tester.cpp +++ b/tester/conference-event-tester.cpp @@ -1081,6 +1081,8 @@ void send_subject_changed_notify () { BC_ASSERT_STRING_EQUAL(tester.confSubject.c_str(), "A random test subject"); BC_ASSERT_EQUAL(tester.participants.size(), 2, int, "%d"); + BC_ASSERT_EQUAL(L_GET_PRIVATE(tester.handler)->getLastNotify(), 1, int, "%d"); + BC_ASSERT_EQUAL(localHandlerPrivate->getLastNotify(), 1, int, "%d"); BC_ASSERT_TRUE(tester.participants.find(bobAddr.asString()) != tester.participants.end()); BC_ASSERT_TRUE(tester.participants.find(aliceAddr.asString()) != tester.participants.end()); BC_ASSERT_TRUE(!tester.participants.find(bobAddr.asString())->second); @@ -1092,6 +1094,8 @@ void send_subject_changed_notify () { BC_ASSERT_STRING_EQUAL(tester.confSubject.c_str(), "Another random test subject..."); BC_ASSERT_EQUAL(tester.participants.size(), 2, int, "%d"); + BC_ASSERT_EQUAL(L_GET_PRIVATE(tester.handler)->getLastNotify(), 2, int, "%d"); + BC_ASSERT_EQUAL(localHandlerPrivate->getLastNotify(), 2, int, "%d"); BC_ASSERT_TRUE(tester.participants.find(bobAddr.asString()) != tester.participants.end()); BC_ASSERT_TRUE(tester.participants.find(aliceAddr.asString()) != tester.participants.end()); BC_ASSERT_TRUE(!tester.participants.find(bobAddr.asString())->second);