diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-09-10 08:02:14 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-09-11 21:53:45 (GMT) |
commit | 37511b6d30cb9cb6c1f5b1fdcca5f6658e4425da (patch) | |
tree | b065e0c34b4705008646a8e06ea9aa34a1bba6e4 /Swiften | |
parent | 904db4e398210192093b688ebf1ad66fb017b6d2 (diff) | |
download | swift-37511b6d30cb9cb6c1f5b1fdcca5f6658e4425da.zip swift-37511b6d30cb9cb6c1f5b1fdcca5f6658e4425da.tar.bz2 |
Fixed VCard photo serializing bug.
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp | 2 | ||||
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp index 11b24dc..82a3ec8 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp @@ -71,7 +71,7 @@ class VCardSerializerTest : public CppUnit::TestFixture "<NICKNAME>DreamGirl</NICKNAME>" "<PHOTO>" "<TYPE>image/png</TYPE>" - "<BINVAL>616263646566</BINVAL>" + "<BINVAL>YWJjZGVm</BINVAL>" "</PHOTO>" "<BDAY>1234</BDAY>" "<MAILER>mutt</MAILER>" diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp index 5953ef6..bb09469 100644 --- a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp @@ -11,7 +11,7 @@ #include "Swiften/Serializer/XML/XMLElement.h" #include "Swiften/Serializer/XML/XMLTextNode.h" #include "Swiften/Serializer/XML/XMLRawTextNode.h" -#include "Swiften/StringCodecs/Hexify.h" +#include "Swiften/StringCodecs/Base64.h" #include "Swiften/Base/foreach.h" namespace Swift { @@ -96,7 +96,7 @@ String VCardSerializer::serializePayload(boost::shared_ptr<VCard> vcard) const } if (!vcard->getPhoto().isEmpty()) { XMLElement::ref binvalElement(new XMLElement("BINVAL")); - binvalElement->addNode(XMLTextNode::ref(new XMLTextNode(Hexify::hexify(vcard->getPhoto())))); + binvalElement->addNode(XMLTextNode::ref(new XMLTextNode(Base64::encode(vcard->getPhoto())))); photoElement->addNode(binvalElement); } queryElement.addNode(photoElement); |