Add a way to disable certain capabilities

This is a way for admins to mitigate some issues caused by caps if such issues ever arise.

E.g. add this to global level in znc.conf:

DisableClientCap = sasl
DisableServerCap = chghost
DisableServerCap = message-tags

Then these caps will be NAKed to client / not requested from server.

Note that this mechanism doesn't fully prevent a cap from being activated, e.g. one could use *send_raw module to request it from server even when disabled.
This commit is contained in:
Alexey Sokolov
2025-05-08 21:55:40 +01:00
parent 1063b7f5d6
commit 1c197a5508
5 changed files with 58 additions and 4 deletions
+3
View File
@@ -416,6 +416,9 @@ bool CIRCSock::OnCapabilityMessage(CMessage& Message) {
sCap = sToken.substr(0, eq);
sValue = sToken.substr(eq + 1);
}
if (CZNC::Get().GetServerCapBlacklist().count(sCap)) {
continue;
}
m_msCapLsValues[sCap] = sValue;
if (OnServerCapAvailable(sCap, sValue) || mSupportedCaps.count(sCap)) {
m_ssPendingCaps.insert(sCap);