diff options
Diffstat (limited to 'Swiften/Serializer/AuthSuccessSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/AuthSuccessSerializer.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Swiften/Serializer/AuthSuccessSerializer.cpp b/Swiften/Serializer/AuthSuccessSerializer.cpp index d506fb9..78fe6a1 100644 --- a/Swiften/Serializer/AuthSuccessSerializer.cpp +++ b/Swiften/Serializer/AuthSuccessSerializer.cpp @@ -16,18 +16,18 @@ AuthSuccessSerializer::AuthSuccessSerializer() { } SafeByteArray AuthSuccessSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const { - boost::shared_ptr<AuthSuccess> authSuccess(boost::dynamic_pointer_cast<AuthSuccess>(element)); - std::string value; - boost::optional<std::vector<unsigned char> > message = authSuccess->getValue(); - if (message) { - if ((*message).empty()) { - value = "="; - } - else { - value = Base64::encode(ByteArray(*message)); - } - } - return createSafeByteArray("<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + value + "</success>"); + boost::shared_ptr<AuthSuccess> authSuccess(boost::dynamic_pointer_cast<AuthSuccess>(element)); + std::string value; + boost::optional<std::vector<unsigned char> > message = authSuccess->getValue(); + if (message) { + if ((*message).empty()) { + value = "="; + } + else { + value = Base64::encode(ByteArray(*message)); + } + } + return createSafeByteArray("<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + value + "</success>"); } } |