From 1db9e5ebf34895c610d97f9f61718781f7b69923 Mon Sep 17 00:00:00 2001 From: 0xd34df00d <0xd34df00d@gmail.com> Date: Wed, 23 Apr 2014 17:29:21 +0400 Subject: Added equality ops for QXmppVCardIq. --- src/base/QXmppVCardIq.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/base/QXmppVCardIq.cpp') diff --git a/src/base/QXmppVCardIq.cpp b/src/base/QXmppVCardIq.cpp index 8733256b..4a237200 100644 --- a/src/base/QXmppVCardIq.cpp +++ b/src/base/QXmppVCardIq.cpp @@ -678,6 +678,34 @@ QXmppVCardIq& QXmppVCardIq::operator=(const QXmppVCardIq &other) return *this; } +/// \brief Checks if two VCard objects represent the same VCard. + +bool operator==(const QXmppVCardIq &left, const QXmppVCardIq &right) +{ + return left.birthday() == right.birthday() && + left.description() == right.description() && + left.email() == right.email() && + left.firstName() == right.firstName() && + left.fullName() == right.fullName() && + left.lastName() == right.lastName() && + left.middleName() == right.middleName() && + left.nickName() == right.nickName() && + left.photo() == right.photo() && + left.photoType() == right.photoType() && + left.url() == right.url() && + left.addresses() == right.addresses() && + left.emails() == right.emails() && + left.phones() == right.phones() && + left.organization() == right.organization(); +} + +/// \brief Checks if two VCard objects represent different VCards. + +bool operator!=(const QXmppVCardIq &left, const QXmppVCardIq &right) +{ + return !(left == right); +} + /// Returns the date of birth of the individual associated with the vCard. /// -- cgit v1.2.3