diff options
Diffstat (limited to 'Swiften/Serializer/AuthResponseSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/AuthResponseSerializer.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Swiften/Serializer/AuthResponseSerializer.cpp b/Swiften/Serializer/AuthResponseSerializer.cpp index 0f3128b..b4be521 100644 --- a/Swiften/Serializer/AuthResponseSerializer.cpp +++ b/Swiften/Serializer/AuthResponseSerializer.cpp @@ -16,19 +16,19 @@ namespace Swift { AuthResponseSerializer::AuthResponseSerializer() { } -SafeByteArray AuthResponseSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const { - boost::shared_ptr<AuthResponse> authResponse(boost::dynamic_pointer_cast<AuthResponse>(element)); - SafeByteArray value; - boost::optional<SafeByteArray> message = authResponse->getValue(); - if (message) { - if ((*message).empty()) { - value = createSafeByteArray(""); - } - else { - value = Base64::encode(*message); - } - } - return concat(createSafeByteArray("<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"), value, createSafeByteArray("</response>")); +SafeByteArray AuthResponseSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const { + boost::shared_ptr<AuthResponse> authResponse(boost::dynamic_pointer_cast<AuthResponse>(element)); + SafeByteArray value; + boost::optional<SafeByteArray> message = authResponse->getValue(); + if (message) { + if ((*message).empty()) { + value = createSafeByteArray(""); + } + else { + value = Base64::encode(*message); + } + } + return concat(createSafeByteArray("<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"), value, createSafeByteArray("</response>")); } } |