core: In CoreNetwork, check Network::useSasl()
authorShane Synan <digitalcircuit36939@gmail.com>
Sun, 8 Nov 2020 03:11:39 +0000 (22:11 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 28 Nov 2020 12:42:31 +0000 (13:42 +0100)
In CoreNetwork, directly check the Network::useSasl() function instead
of reaching into networkInfo().  All the other code within CoreNetwork
checks the properties on Network, and useSasl() is already updated
within Network::setNetworkInfo().  This provides consistency with
atomic network information updates.

src/core/corenetwork.cpp

index 438a42a..17cf26d 100644 (file)
@@ -1086,8 +1086,9 @@ void CoreNetwork::serverCapAdded(const QString& capability)
     // Handle special cases first
     if (capability == IrcCap::SASL) {
         // Only request SASL if it's enabled
-        if (networkInfo().useSasl)
+        if (useSasl()) {
             queueCap(capability);
+        }
     }
     else if (IrcCap::knownCaps.contains(capability)) {
         // Handling for general known capabilities
@@ -1367,7 +1368,7 @@ void CoreNetwork::sendNextCap()
     else {
         // No pending desired capabilities, capability negotiation finished
         // If SASL requested but not available, print a warning
-        if (networkInfo().useSasl && !capEnabled(IrcCap::SASL))
+        if (useSasl() && !capEnabled(IrcCap::SASL))
             showMessage(NetworkInternalMessage(
                 Message::Error,
                 BufferInfo::StatusBuffer,