summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-09-28 16:45:00 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-09-28 16:45:00 (GMT)
commit1daf22de85758cfd035f1fcf6a70007315db4f28 (patch)
treeae822e3db619af06ec1b26fd342165b24fe89543 /Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp
parent5c544f02222a3318b8581f68071b6a6b66b1d4c0 (diff)
downloadswift-contrib-1daf22de85758cfd035f1fcf6a70007315db4f28.zip
swift-contrib-1daf22de85758cfd035f1fcf6a70007315db4f28.tar.bz2
Destroy rooms.
Resolves: #990
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp')
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp
index 0a8153d..68662b1 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp
@@ -13,11 +13,13 @@
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLElement.h>
#include <Swiften/Serializer/XML/XMLTextNode.h>
+#include <Swiften/Serializer/XML/XMLRawTextNode.h>
#include <Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h>
+#include <Swiften/Serializer/PayloadSerializerCollection.h>
namespace Swift {
-MUCUserPayloadSerializer::MUCUserPayloadSerializer() : GenericPayloadSerializer<MUCUserPayload>() {
+MUCUserPayloadSerializer::MUCUserPayloadSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer<MUCUserPayload>(), serializers(serializers) {
}
std::string MUCUserPayloadSerializer::serializePayload(boost::shared_ptr<MUCUserPayload> payload) const {
@@ -32,6 +34,13 @@ std::string MUCUserPayloadSerializer::serializePayload(boost::shared_ptr<MUCUser
foreach (const MUCItem item, payload->getItems()) {
mucElement.addNode(MUCItemSerializer::itemToElement(item));
}
+ boost::shared_ptr<Payload> childPayload = payload->getPayload();
+ if (childPayload) {
+ PayloadSerializer* serializer = serializers->getPayloadSerializer(childPayload);
+ if (serializer) {
+ mucElement.addNode(boost::shared_ptr<XMLRawTextNode>(new XMLRawTextNode(serializer->serialize(childPayload))));
+ }
+ }
return mucElement.serialize();
}