diff options
Diffstat (limited to 'Swiften/Serializer/AuthRequestSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/AuthRequestSerializer.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Swiften/Serializer/AuthRequestSerializer.cpp b/Swiften/Serializer/AuthRequestSerializer.cpp index bde0d2d..f479eac 100644 --- a/Swiften/Serializer/AuthRequestSerializer.cpp +++ b/Swiften/Serializer/AuthRequestSerializer.cpp @@ -17,18 +17,18 @@ AuthRequestSerializer::AuthRequestSerializer() { } SafeByteArray AuthRequestSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const { - boost::shared_ptr<AuthRequest> authRequest(boost::dynamic_pointer_cast<AuthRequest>(element)); - SafeByteArray value; - boost::optional<SafeByteArray> message = authRequest->getMessage(); - if (message) { - if ((*message).empty()) { - value = createSafeByteArray("="); - } - else { - value = Base64::encode(*message); - } - } - return concat(createSafeByteArray("<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"" + authRequest->getMechanism() + "\">"), value, createSafeByteArray("</auth>")); + boost::shared_ptr<AuthRequest> authRequest(boost::dynamic_pointer_cast<AuthRequest>(element)); + SafeByteArray value; + boost::optional<SafeByteArray> message = authRequest->getMessage(); + if (message) { + if ((*message).empty()) { + value = createSafeByteArray("="); + } + else { + value = Base64::encode(*message); + } + } + return concat(createSafeByteArray("<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"" + authRequest->getMechanism() + "\">"), value, createSafeByteArray("</auth>")); } } |