From: Shane Synan Date: Tue, 27 Feb 2018 19:50:43 +0000 (-0600) Subject: core: Fix CAP REQ display for SASL only supported X-Git-Tag: travis-deploy-test~142 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=44f5b91807ce2181d9c151d9e93f12e3f798aa0e core: Fix CAP REQ display for SASL only supported Modify queuedCapsDisplay to only add a ", " when both _capsQueuedIndividual and _capsQueuedBundled are not empty. This avoids adding a spurious ", " when there's only individual caps, e.g. SASL. Though the docs don't mention it, QStringList.join() will only add the separator when there's more than one item in the list. Before: * Negotiating capabilities (requesting: sasl, )... After: * Negotiating capabilities (requesting: sasl)... See https://doc.qt.io/qt-5/qstringlist.html#join Closes GH-334. --- diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 24be4c1a..198e1142 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -1210,9 +1210,10 @@ void CoreNetwork::beginCapNegotiation() tr("Ready to negotiate (found: %1)").arg(caps().join(", "))); // Build a list of queued capabilities, starting with individual, then bundled, only adding the - // comma separator between the two if needed. + // comma separator between the two if needed (both individual and bundled caps exist). QString queuedCapsDisplay = - (!_capsQueuedIndividual.empty() ? _capsQueuedIndividual.join(", ") + ", " : "") + _capsQueuedIndividual.join(", ") + + ((!_capsQueuedIndividual.empty() && !_capsQueuedBundled.empty()) ? ", " : "") + _capsQueuedBundled.join(", "); displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Negotiating capabilities (requesting: %1)...").arg(queuedCapsDisplay));