Skip to content

Commit

Permalink
Credentials: Add comparison operator
Browse files Browse the repository at this point in the history
  • Loading branch information
lnjX committed Jun 20, 2024
1 parent 76a874a commit e7dd83b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/base/QXmppSasl_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ inline QDebug operator<<(QDebug dbg, SaslMechanism mechanism) { return dbg << me
struct HtToken {
static std::optional<HtToken> fromXml(QXmlStreamReader &);
void toXml(QXmlStreamWriter &) const;
bool operator==(const HtToken &other) const = default;

SaslHtMechanism mechanism;
QString secret;
Expand Down
5 changes: 5 additions & 0 deletions src/client/QXmppConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ void QXmppCredentials::toXml(QXmlStreamWriter &writer) const
writer.writeEndElement();
}

bool QXmppCredentials::operator==(const QXmppCredentials &other) const
{
return d->htToken == other.d->htToken;
}

class QXmppConfigurationPrivate : public QSharedData
{
public:
Expand Down
5 changes: 5 additions & 0 deletions src/client/QXmppCredentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class QXMPP_EXPORT QXmppCredentials
static std::optional<QXmppCredentials> fromXml(QXmlStreamReader &);
void toXml(QXmlStreamWriter &) const;

/// Comparison operator
bool operator==(const QXmppCredentials &other) const;
/// Comparison operator
bool operator!=(const QXmppCredentials &other) const = default;

private:
friend class QXmppConfiguration;

Expand Down

0 comments on commit e7dd83b

Please sign in to comment.