X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcorenetwork.cpp;h=0dfb33b75b481bdd5eef685de95ee5aa0546e4f6;hb=df38a9238d603ec8d2040619befa50980d994916;hp=8506dea2a6df9840527a4fc689fce2bf3231bff2;hpb=8961f348947fc55cc4bc769563684af3f2ea7ccc;p=quassel.git diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 8506dea2..0dfb33b7 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2019 by the Quassel Project * + * Copyright (C) 2005-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -1267,16 +1267,37 @@ void CoreNetwork::retryCapsIndividually() void CoreNetwork::beginCapNegotiation() { - // Don't begin negotiation if no capabilities are queued to request - if (!capNegotiationInProgress()) { - // If the server doesn't have any capabilities, but supports CAP LS, continue on with the - // normal connection. + if (!capsPendingNegotiation()) { + // No capabilities are queued for request, determine the reason why + QString capStatusMsg; + if (caps().empty()) { + // The server doesn't provide any capabilities, but supports CAP LS + capStatusMsg = tr("No capabilities available"); + } + else if (capsEnabled().empty()) { + // The server supports capabilities (caps() is not empty) but Quassel doesn't support + // anything offered. This should be uncommon. + capStatusMsg = + tr("None of the capabilities provided by the server are supported (found: %1)") + .arg(caps().join(", ")); + } + else { + // Quassel has enabled some capabilities, but there are no further capabilities that can + // be negotiated. + // (E.g. the user has manually run "/cap ls 302" after initial negotiation.) + capStatusMsg = + tr("No additional capabilities are supported (found: %1; currently enabled: %2)") + .arg(caps().join(", "), capsEnabled().join(", ")); + } + // Inform the user of the situation showMessage(NetworkInternalMessage( Message::Server, BufferInfo::StatusBuffer, "", - tr("No capabilities available") + capStatusMsg )); + + // End any ongoing capability negotiation, allowing connection to continue endCapNegotiation(); return; } @@ -1306,7 +1327,7 @@ void CoreNetwork::beginCapNegotiation() void CoreNetwork::sendNextCap() { - if (capNegotiationInProgress()) { + if (capsPendingNegotiation()) { // Request the next set of capabilities and remove them from the list putRawLine(serverEncode(QString("CAP REQ :%1").arg(takeQueuedCaps()))); }