diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp index 479d6be..205d9e0 100644 --- a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp @@ -21,43 +21,43 @@ ResultSetSerializer::~ResultSetSerializer() { } std::string ResultSetSerializer::serializePayload(boost::shared_ptr<ResultSet> payload) const { - if (!payload) { - return ""; - } + if (!payload) { + return ""; + } - XMLElement element("set", "http://jabber.org/protocol/rsm"); + XMLElement element("set", "http://jabber.org/protocol/rsm"); - if (payload->getMaxItems()) { - element.addNode(boost::make_shared<XMLElement>("max", "", boost::lexical_cast<std::string>(*payload->getMaxItems()))); - } + if (payload->getMaxItems()) { + element.addNode(boost::make_shared<XMLElement>("max", "", boost::lexical_cast<std::string>(*payload->getMaxItems()))); + } - if (payload->getCount()) { - element.addNode(boost::make_shared<XMLElement>("count", "", boost::lexical_cast<std::string>(*payload->getCount()))); - } + if (payload->getCount()) { + 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->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()) { - firstElement->setAttribute("index", boost::lexical_cast<std::string>(*payload->getFirstIDIndex())); - } - element.addNode(firstElement); - } + if (payload->getFirstID()) { + boost::shared_ptr<XMLElement> firstElement = boost::make_shared<XMLElement>("first", "", *payload->getFirstID()); + if (payload->getFirstIDIndex()) { + firstElement->setAttribute("index", boost::lexical_cast<std::string>(*payload->getFirstIDIndex())); + } + element.addNode(firstElement); + } - if (payload->getLastID()) { - element.addNode(boost::make_shared<XMLElement>("last", "", *payload->getLastID())); - } + if (payload->getLastID()) { + element.addNode(boost::make_shared<XMLElement>("last", "", *payload->getLastID())); + } - if (payload->getBefore()) { - element.addNode(boost::make_shared<XMLElement>("before", "", *payload->getBefore())); - } + if (payload->getBefore()) { + element.addNode(boost::make_shared<XMLElement>("before", "", *payload->getBefore())); + } - if (payload->getAfter()) { - element.addNode(boost::make_shared<XMLElement>("after", "", *payload->getAfter())); - } + if (payload->getAfter()) { + element.addNode(boost::make_shared<XMLElement>("after", "", *payload->getAfter())); + } - return element.serialize(); + return element.serialize(); } |