summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Mons <edwin.mons@isode.com>2014-12-10 16:50:27 (GMT)
committerSwift Review <review@swift.im>2014-12-14 14:47:01 (GMT)
commit6948ef81d66680858b88b1bc7dc67687310f57cf (patch)
tree3aeb638051bfac666924b7479ff201e095ae048c /Swiften/Serializer/PayloadSerializers
parentb4a54583c4d575fe152122c21da616c3c942bbfd (diff)
downloadswift-6948ef81d66680858b88b1bc7dc67687310f57cf.zip
swift-6948ef81d66680858b88b1bc7dc67687310f57cf.tar.bz2
Add index element to ResultSet
The index element was missing, added it in Swiften and Sluift. Change-Id: I709037fafcc5242c7c2e2fddb8469316c106d51a
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers')
-rw-r--r--Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp
index 0f464a4..263c7de 100644
--- a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp
@@ -33,6 +33,10 @@ std::string ResultSetSerializer::serializePayload(boost::shared_ptr<ResultSet> p
element.addNode(boost::make_shared<XMLElement>("count", "", boost::lexical_cast<std::string>(*payload->getCount())));
}
+ if (payload->getIndex()) {
+ element.addNode(boost::make_shared<XMLElement>("index", "", boost::lexical_cast<std::string>(*payload->getIndex())));
+ }
+
if (payload->getFirstID()) {
boost::shared_ptr<XMLElement> firstElement = boost::make_shared<XMLElement>("first", "", *payload->getFirstID());
if (payload->getFirstIDIndex()) {
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp
index 354db85..7431fcd 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp
@@ -32,6 +32,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
resultSet->setMaxItems(100);
resultSet->setCount(800);
+ resultSet->setIndex(0);
resultSet->setFirstIDIndex(123);
resultSet->setFirstID(std::string("stpeter@jabber.org"));
resultSet->setLastID(std::string("peterpan@neverland.lit"));
@@ -42,6 +43,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
"<set xmlns=\"http://jabber.org/protocol/rsm\">"
"<max>100</max>"
"<count>800</count>"
+ "<index>0</index>"
"<first index=\"123\">stpeter@jabber.org</first>"
"<last>peterpan@neverland.lit</last>"
"<before>decaf-badba-dbad1</before>"