summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer')
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp4
2 files changed, 10 insertions, 2 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp
index 7080e14..58f78b8 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp
@@ -7,9 +7,11 @@
#include <Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h>
#include <boost/lexical_cast.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <Swiften/Serializer/XML/XMLElement.h>
+#include <Swiften/Serializer/XML/XMLTextNode.h>
#include <Swiften/Base/String.h>
namespace Swift {
@@ -40,6 +42,12 @@ std::string MUCPayloadSerializer::serializePayload(boost::shared_ptr<MUCPayload>
historyElement->setAttribute("since", sinceString);
history = true;
}
+ if (muc->getPassword()) {
+ std::string password = *muc->getPassword();
+ boost::shared_ptr<XMLElement> passwordElement(new XMLElement("password"));
+ passwordElement->addNode(boost::make_shared<XMLTextNode>(password));
+ mucElement.addNode(passwordElement);
+ }
if (history) {
mucElement.addNode(historyElement);
}
diff --git a/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp
index 30adf26..77fb3c0 100644
--- a/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp
@@ -30,9 +30,9 @@ std::string StorageSerializer::serializePayload(boost::shared_ptr<Storage> stora
nickElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(room.nick)));
conferenceElement->addNode(nickElement);
}
- if (!room.password.empty()) {
+ if (room.password) {
boost::shared_ptr<XMLElement> passwordElement(new XMLElement("password"));
- passwordElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(room.password)));
+ passwordElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(*room.password)));
conferenceElement->addNode(passwordElement);
}
storageElement.addNode(conferenceElement);