aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-10-11 11:50:16 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-10-11 11:50:16 +0000
commit7e66378dc28da241e633ffb4ee4ece7afe1ee1ce (patch)
tree12cf9d0477e46f60964a367109c30bc5f09ba089 /src
parentd0738485bbcb2de6fd0e78f90437ac6aa27113e7 (diff)
downloadqxmpp-7e66378dc28da241e633ffb4ee4ece7afe1ee1ce.tar.gz
encode / decode presence photo hash to / from base64
Diffstat (limited to 'src')
-rw-r--r--src/QXmppPresence.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/QXmppPresence.cpp b/src/QXmppPresence.cpp
index f6e58b6f..00746fdd 100644
--- a/src/QXmppPresence.cpp
+++ b/src/QXmppPresence.cpp
@@ -84,7 +84,7 @@ void QXmppPresence::parse(const QDomElement &element)
QDomElement photoElement = xElement.firstChildElement("photo");
if(!photoElement.isNull())
{
- m_photoHash = photoElement.text().toUtf8();
+ m_photoHash = QByteArray::fromBase64(photoElement.text().toAscii());
if(m_photoHash.isEmpty())
m_vCardUpdateType = PhotoNotAdvertized;
else
@@ -92,7 +92,7 @@ void QXmppPresence::parse(const QDomElement &element)
}
else
{
- m_photoHash = "";
+ m_photoHash = QByteArray();
m_vCardUpdateType = PhotoNotReady;
}
}
@@ -149,7 +149,7 @@ void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const
helperToXmlAddTextElement(xmlWriter, "photo", "");
break;
case PhotoAdvertised:
- helperToXmlAddTextElement(xmlWriter, "photo", m_photoHash);
+ helperToXmlAddTextElement(xmlWriter, "photo", m_photoHash.toBase64());
break;
case PhotoNotReady:
break;