summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Mons <edwin.mons@isode.com>2014-05-09 14:25:29 (GMT)
committerEdwin Mons <edwin.mons@isode.com>2014-05-12 08:49:36 (GMT)
commit634555e64572531fece2a955d1168a88c7979d09 (patch)
tree4a7d50488d4adf60b24091e6308e7d4c30b350e7 /Swiften/Parser
parentafa4aa4a38991fc219d71604baab4d64a2082629 (diff)
downloadswift-634555e64572531fece2a955d1168a88c7979d09.zip
swift-634555e64572531fece2a955d1168a88c7979d09.tar.bz2
Add support for <before/> to ResultSet
Change-Id: I46bd9f24fc887b180cee3c2aa75a6c9e1761473b
Diffstat (limited to 'Swiften/Parser')
-rw-r--r--Swiften/Parser/PayloadParsers/ResultSetParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/ResultSetParser.cpp b/Swiften/Parser/PayloadParsers/ResultSetParser.cpp
index 95960d7..4c8283b 100644
--- a/Swiften/Parser/PayloadParsers/ResultSetParser.cpp
+++ b/Swiften/Parser/PayloadParsers/ResultSetParser.cpp
@@ -47,6 +47,8 @@ void ResultSetParser::handleEndElement(const std::string& element, const std::st
getPayloadInternal()->setFirstID(currentText_);
} else if (element == "last") {
getPayloadInternal()->setLastID(currentText_);
+ } else if (element == "before") {
+ getPayloadInternal()->setBefore(currentText_);
} else if (element == "after") {
getPayloadInternal()->setAfter(currentText_);
}
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp
index 68df71b..e345323 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp
@@ -28,6 +28,7 @@ class ResultSetParserTest : public CppUnit::TestFixture
"<count>800</count>"
"<first index=\"123\">stpeter@jabber.org</first>"
"<last>peterpan@neverland.lit</last>"
+ "<before>decaf-badba-dbad1</before>"
"<after>09af3-cc343-b409f</after>"
"</set>"));
@@ -43,6 +44,8 @@ class ResultSetParserTest : public CppUnit::TestFixture
CPPUNIT_ASSERT_EQUAL(123, *payload->getFirstIDIndex());
CPPUNIT_ASSERT(payload->getLastID());
CPPUNIT_ASSERT_EQUAL(std::string("peterpan@neverland.lit"), *payload->getLastID());
+ CPPUNIT_ASSERT(payload->getBefore());
+ CPPUNIT_ASSERT_EQUAL(std::string("decaf-badba-dbad1"), *payload->getBefore());
CPPUNIT_ASSERT(payload->getAfter());
CPPUNIT_ASSERT_EQUAL(std::string("09af3-cc343-b409f"), *payload->getAfter());
}