From eebabe9514044150c2dbff477a8752c1649054bc Mon Sep 17 00:00:00 2001 From: Shane Synan Date: Sun, 28 Aug 2016 16:49:07 -0500 Subject: [PATCH] Network::clearCaps only sync when caps removed Add check for if _caps and _capsEnabled contain any capabilities. If not, return from the clearCaps call without issuing a network SYNC. Fixes needless clearCaps calls when reconnecting to a network that's failing to connect. This may cause inconsistency if clients miss some sync calls.. but Quassel protocol currently depends on all sync calls being propogated anyways. --- src/common/network.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/network.cpp b/src/common/network.cpp index cde2af76..b1e4519a 100644 --- a/src/common/network.cpp +++ b/src/common/network.cpp @@ -746,6 +746,10 @@ void Network::removeCap(const QString &capability) void Network::clearCaps() { // IRCv3 specs all use lowercase capability names + if (_caps.empty() && _capsEnabled.empty()) { + // Avoid the sync call if there's nothing to clear (e.g. failed reconnects) + return; + } // To ease core-side configuration, loop through the list and emit capRemoved for each entry. // If performance issues arise, this can be converted to a more-efficient setup without breaking // protocol (in theory). -- 2.20.1