mirror of
https://github.com/znc/znc.git
synced 2026-07-06 01:41:12 +02:00
Add support for some capabilities
multi-prefix is just NAMESX' CAP name and userhost-in-names is just UHNAMES for CAP. This makes it pretty easy to make them work. :) git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2024 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+32
-4
@@ -788,15 +788,43 @@ void CClient::HandleCap(const CString& sLine)
|
||||
CString sSubCmd = sLine.Token(1);
|
||||
|
||||
if (sSubCmd.Equals("LS")) {
|
||||
RespondCap("LS :");
|
||||
RespondCap("LS :userhost-in-names multi-prefix");
|
||||
m_bInCap = true;
|
||||
} else if (sSubCmd.Equals("END")) {
|
||||
m_bInCap = false;
|
||||
AuthUser();
|
||||
} else if (sSubCmd.Equals("REQ")) {
|
||||
// No capabilities supported for now
|
||||
RespondCap("NAK :" + sLine.Token(2, true).TrimPrefix_n(":"));
|
||||
bool bReqUHNames = false;
|
||||
bool bReqNamesx = false;
|
||||
|
||||
VCString vsTokens;
|
||||
VCString::iterator it;
|
||||
sLine.Token(2).TrimPrefix_n(":").Split(" ", vsTokens, false);
|
||||
|
||||
for (it = vsTokens.begin(); it != vsTokens.end(); ++it) {
|
||||
if (*it == "multi-prefix") {
|
||||
bReqNamesx = true;
|
||||
} else if (*it == "userhost-in-names") {
|
||||
bReqUHNames = true;
|
||||
} else {
|
||||
// Some unsupported capability is requested
|
||||
RespondCap("NAK :" + sLine.Token(2, true).TrimPrefix_n(":"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// All is fine, we support what was requested
|
||||
RespondCap("ACK :" + sLine.Token(2, true).TrimPrefix_n(":"));
|
||||
if (bReqUHNames)
|
||||
m_bUHNames = true;
|
||||
if (bReqNamesx)
|
||||
m_bNamesx = true;
|
||||
} else if (sSubCmd.Equals("LIST")) {
|
||||
RespondCap("LIST :");
|
||||
CString sList = "";
|
||||
if (m_bNamesx)
|
||||
sList += "multi-prefix ";
|
||||
if (m_bUHNames)
|
||||
sList += "userhost-in-names ";
|
||||
RespondCap("LIST :" + sList.TrimSuffix_n(" "));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user