summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer/StreamFeaturesSerializer.cpp')
-rw-r--r--Swiften/Serializer/StreamFeaturesSerializer.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/Swiften/Serializer/StreamFeaturesSerializer.cpp b/Swiften/Serializer/StreamFeaturesSerializer.cpp
index 915433c..3c500e3 100644
--- a/Swiften/Serializer/StreamFeaturesSerializer.cpp
+++ b/Swiften/Serializer/StreamFeaturesSerializer.cpp
@@ -4,18 +4,20 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Serializer/StreamFeaturesSerializer.h"
+#include <Swiften/Serializer/StreamFeaturesSerializer.h>
-#include "Swiften/Serializer/XML/XMLElement.h"
-#include "Swiften/Serializer/XML/XMLTextNode.h"
-#include "Swiften/Base/foreach.h"
+#include <boost/smart_ptr/make_shared.hpp>
+
+#include <Swiften/Serializer/XML/XMLElement.h>
+#include <Swiften/Serializer/XML/XMLTextNode.h>
+#include <Swiften/Base/foreach.h>
namespace Swift {
StreamFeaturesSerializer::StreamFeaturesSerializer() {
}
-std::string StreamFeaturesSerializer::serialize(boost::shared_ptr<Element> element) const {
+SafeString StreamFeaturesSerializer::serialize(boost::shared_ptr<Element> element) const {
boost::shared_ptr<StreamFeatures> streamFeatures(boost::dynamic_pointer_cast<StreamFeatures>(element));
XMLElement streamFeaturesElement("stream:features");
@@ -49,6 +51,9 @@ std::string StreamFeaturesSerializer::serialize(boost::shared_ptr<Element> eleme
if (streamFeatures->hasStreamManagement()) {
streamFeaturesElement.addNode(boost::shared_ptr<XMLElement>(new XMLElement("sm", "urn:xmpp:sm:2")));
}
+ if (streamFeatures->hasRosterVersioning()) {
+ streamFeaturesElement.addNode(boost::make_shared<XMLElement>("ver", "urn:xmpp:features:rosterver"));
+ }
return streamFeaturesElement.serialize();
}