diff options
Diffstat (limited to 'Swiften/Serializer')
-rw-r--r-- | Swiften/Serializer/StreamFeaturesSerializer.cpp | 3 | ||||
-rw-r--r-- | Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/Serializer/StreamFeaturesSerializer.cpp b/Swiften/Serializer/StreamFeaturesSerializer.cpp index 540a8d1..ec21983 100644 --- a/Swiften/Serializer/StreamFeaturesSerializer.cpp +++ b/Swiften/Serializer/StreamFeaturesSerializer.cpp @@ -46,6 +46,9 @@ String StreamFeaturesSerializer::serialize(boost::shared_ptr<Element> element) if (streamFeatures->hasSession()) { streamFeaturesElement.addNode(boost::shared_ptr<XMLElement>(new XMLElement("session", "urn:ietf:params:xml:ns:xmpp-session"))); } + if (streamFeatures->hasStreamManagement()) { + streamFeaturesElement.addNode(boost::shared_ptr<XMLElement>(new XMLElement("sm", "urn:xmpp:sm:2"))); + } return streamFeaturesElement.serialize(); } diff --git a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp index 81eeacb..bd39bd8 100644 --- a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp @@ -31,6 +31,7 @@ class StreamFeaturesSerializerTest : public CppUnit::TestFixture streamFeatures->addAuthenticationMechanism("PLAIN"); streamFeatures->setHasResourceBind(); streamFeatures->setHasSession(); + streamFeatures->setHasStreamManagement(); CPPUNIT_ASSERT_EQUAL(String( "<stream:features>" @@ -45,6 +46,7 @@ class StreamFeaturesSerializerTest : public CppUnit::TestFixture "</mechanisms>" "<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>" "<session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"/>" + "<sm xmlns=\"urn:xmpp:sm:2\"/>" "</stream:features>"), testling.serialize(streamFeatures)); } }; |