summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-06-03 12:25:57 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-06-03 12:46:12 (GMT)
commit21fda3308975201eeebeacd98e2b587ef4448862 (patch)
treee8aebe473a636cf5a312814d4054d8af0d9ad6a6 /Swiften/Serializer/AuthResponseSerializer.cpp
parent10334c139670861d4860da59ad837fc3fe6fd41e (diff)
downloadswift-contrib-21fda3308975201eeebeacd98e2b587ef4448862.zip
swift-contrib-21fda3308975201eeebeacd98e2b587ef4448862.tar.bz2
Limit the use of the SafeString type.
Diffstat (limited to 'Swiften/Serializer/AuthResponseSerializer.cpp')
-rw-r--r--Swiften/Serializer/AuthResponseSerializer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Swiften/Serializer/AuthResponseSerializer.cpp b/Swiften/Serializer/AuthResponseSerializer.cpp
index 5b166b7..86b7fbe 100644
--- a/Swiften/Serializer/AuthResponseSerializer.cpp
+++ b/Swiften/Serializer/AuthResponseSerializer.cpp
@@ -9,7 +9,6 @@
#include <Swiften/Elements/AuthResponse.h>
#include <Swiften/StringCodecs/Base64.h>
#include <Swiften/Base/SafeByteArray.h>
-#include <Swiften/Base/SafeString.h>
#include <Swiften/Base/Concat.h>
namespace Swift {
@@ -17,19 +16,19 @@ namespace Swift {
AuthResponseSerializer::AuthResponseSerializer() {
}
-SafeString AuthResponseSerializer::serialize(boost::shared_ptr<Element> element) const {
+SafeByteArray AuthResponseSerializer::serialize(boost::shared_ptr<Element> element) const {
boost::shared_ptr<AuthResponse> authResponse(boost::dynamic_pointer_cast<AuthResponse>(element));
- SafeString value;
+ SafeByteArray value;
boost::optional<SafeByteArray> message = authResponse->getValue();
if (message) {
if ((*message).empty()) {
- value = "=";
+ value = createSafeByteArray("=");
}
else {
value = Base64::encode(*message);
}
}
- return concat(SafeString("<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"), value, SafeString("</response>"));
+ return concat(createSafeByteArray("<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"), value, createSafeByteArray("</response>"));
}
}