X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fnetwork.cpp;fp=src%2Fcommon%2Fnetwork.cpp;h=cb4adb5c82cc794bdbe89609b9026aba24acec83;hp=d768837f5408449a3a1697cd0b800a82ed925e89;hb=0b983b0d9364e62db0b5e6cf25988ef8041a0c5d;hpb=5f13dd167785d830a851b134863dce231ec450dd diff --git a/src/common/network.cpp b/src/common/network.cpp index d768837f..cb4adb5c 100644 --- a/src/common/network.cpp +++ b/src/common/network.cpp @@ -241,6 +241,20 @@ QString Network::support(const QString ¶m) const } +bool Network::saslMaybeSupports(const QString &saslMechanism) const +{ + // Get the SASL capability value + QString saslCapValue = capValue(IrcCap::SASL); + // SASL mechanisms are only specified in capability values as part of SASL 3.2. In SASL 3.1, + // it's handled differently. If we don't know via capability value, assume it's supported to + // reduce the risk of breaking existing setups. + // See: http://ircv3.net/specs/extensions/sasl-3.1.html + // And: http://ircv3.net/specs/extensions/sasl-3.2.html + return (saslCapValue.length() == 0) + || (saslCapValue.contains(saslMechanism, Qt::CaseInsensitive)); +} + + IrcUser *Network::newIrcUser(const QString &hostmask, const QVariantMap &initData) { QString nick(nickFromMask(hostmask).toLower());