mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Support disabling CAPabilities
This commits adds support for cap commands like this one: CAP REQ :-multi-prefix git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2027 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
12
Client.cpp
12
Client.cpp
@@ -796,16 +796,24 @@ void CClient::HandleCap(const CString& sLine)
|
||||
} else if (sSubCmd.Equals("REQ")) {
|
||||
bool bReqUHNames = false;
|
||||
bool bReqNamesx = false;
|
||||
bool bValueUHNames = false;
|
||||
bool bValueNamesx = false;
|
||||
|
||||
VCString vsTokens;
|
||||
VCString::iterator it;
|
||||
sLine.Token(2).TrimPrefix_n(":").Split(" ", vsTokens, false);
|
||||
|
||||
for (it = vsTokens.begin(); it != vsTokens.end(); ++it) {
|
||||
bool bVal = true;
|
||||
if (it->TrimPrefix("-"))
|
||||
bVal = false;
|
||||
|
||||
if (*it == "multi-prefix") {
|
||||
bReqNamesx = true;
|
||||
bValueNamesx = bVal;
|
||||
} else if (*it == "userhost-in-names") {
|
||||
bReqUHNames = true;
|
||||
bValueUHNames = bVal;
|
||||
} else {
|
||||
// Some unsupported capability is requested
|
||||
RespondCap("NAK :" + sLine.Token(2, true).TrimPrefix_n(":"));
|
||||
@@ -816,9 +824,9 @@ void CClient::HandleCap(const CString& sLine)
|
||||
// All is fine, we support what was requested
|
||||
RespondCap("ACK :" + sLine.Token(2, true).TrimPrefix_n(":"));
|
||||
if (bReqUHNames)
|
||||
m_bUHNames = true;
|
||||
m_bUHNames = bValueUHNames;
|
||||
if (bReqNamesx)
|
||||
m_bNamesx = true;
|
||||
m_bNamesx = bValueNamesx;
|
||||
} else if (sSubCmd.Equals("LIST")) {
|
||||
CString sList = "";
|
||||
if (m_bNamesx)
|
||||
|
||||
Reference in New Issue
Block a user