mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Add server time CAP and Client flag.
This commit is contained in:
@@ -768,7 +768,7 @@ void CClient::HandleCap(const CString& sLine)
|
||||
for (SCString::iterator i = ssOfferCaps.begin(); i != ssOfferCaps.end(); ++i) {
|
||||
sRes += *i + " ";
|
||||
}
|
||||
RespondCap("LS :" + sRes + "userhost-in-names multi-prefix");
|
||||
RespondCap("LS :" + sRes + "userhost-in-names multi-prefix znc.in/server-time");
|
||||
m_bInCap = true;
|
||||
} else if (sSubCmd.Equals("END")) {
|
||||
m_bInCap = false;
|
||||
@@ -784,7 +784,7 @@ void CClient::HandleCap(const CString& sLine)
|
||||
if (sCap.TrimPrefix("-"))
|
||||
bVal = false;
|
||||
|
||||
bool bAccepted = ("multi-prefix" == sCap) || ("userhost-in-names" == sCap);
|
||||
bool bAccepted = ("multi-prefix" == sCap) || ("userhost-in-names" == sCap) || ("znc.in/server-time" == sCap);
|
||||
GLOBALMODULECALL(IsClientCapSupported(this, sCap, bVal), bAccepted = true);
|
||||
|
||||
if (!bAccepted) {
|
||||
@@ -804,6 +804,8 @@ void CClient::HandleCap(const CString& sLine)
|
||||
m_bNamesx = bVal;
|
||||
} else if ("userhost-in-names" == *it) {
|
||||
m_bUHNames = bVal;
|
||||
} else if ("znc.in/server-time" == *it) {
|
||||
m_bServerTime = bVal;
|
||||
}
|
||||
GLOBALMODULECALL(OnClientCapRequest(this, *it, bVal), NOTHING);
|
||||
|
||||
@@ -839,6 +841,10 @@ void CClient::HandleCap(const CString& sLine)
|
||||
m_bUHNames = false;
|
||||
ssRemoved.insert("userhost-in-names");
|
||||
}
|
||||
if (m_bServerTime) {
|
||||
m_bServerTime = false;
|
||||
ssRemoved.insert("znc.in/server-time");
|
||||
}
|
||||
CString sList = "";
|
||||
for (SCString::iterator i = ssRemoved.begin(); i != ssRemoved.end(); ++i) {
|
||||
m_ssAcceptedCaps.erase(*i);
|
||||
|
||||
Reference in New Issue
Block a user