aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-08-26 07:53:46 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-08-26 07:53:46 +0000
commite2e56fc1426f408aacb4b458e8773aae1d2494e9 (patch)
tree53ae6b75fbfbab071c4a1dc9d9270134555f3501 /src
parent821ac0b4dbeccd98d4483efcafecd82efbd55d8f (diff)
downloadqxmpp-e2e56fc1426f408aacb4b458e8773aae1d2494e9.tar.gz
add QXmppVCard::isVCard for consistency
Diffstat (limited to 'src')
-rw-r--r--src/QXmppOutgoingClient.cpp3
-rw-r--r--src/QXmppVCard.cpp5
-rw-r--r--src/QXmppVCard.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/src/QXmppOutgoingClient.cpp b/src/QXmppOutgoingClient.cpp
index d6788914..9756eb76 100644
--- a/src/QXmppOutgoingClient.cpp
+++ b/src/QXmppOutgoingClient.cpp
@@ -508,8 +508,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv)
emit ibbOpenIqReceived(ibbOpenIq);
}
// XEP-0054: vcard-temp
- else if(nodeRecv.firstChildElement("vCard").
- namespaceURI() == ns_vcard)
+ else if(QXmppVCard::isVCard(nodeRecv))
{
QXmppVCard vcardIq;
vcardIq.parse(nodeRecv);
diff --git a/src/QXmppVCard.cpp b/src/QXmppVCard.cpp
index c6d8fb84..598ed1f7 100644
--- a/src/QXmppVCard.cpp
+++ b/src/QXmppVCard.cpp
@@ -149,6 +149,11 @@ void QXmppVCard::setPhoto(const QImage& image)
}
#endif
+bool QXmppVCard::isVCard(const QDomElement &nodeRecv)
+{
+ return nodeRecv.firstChildElement("vCard").namespaceURI() == ns_vcard;
+}
+
void QXmppVCard::parseElementFromChild(const QDomElement& nodeRecv)
{
// vCard
diff --git a/src/QXmppVCard.h b/src/QXmppVCard.h
index 446f645e..7e731e83 100644
--- a/src/QXmppVCard.h
+++ b/src/QXmppVCard.h
@@ -66,6 +66,8 @@ public:
QImage photoAsImage() const;
const QByteArray& photo() const;
+ static bool isVCard(const QDomElement &element);
+
// deprecated accessors, use the form without "get" instead
/// \cond
QString Q_DECL_DEPRECATED getFullName() const;