summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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>"