diff --git a/include/znc/Client.h b/include/znc/Client.h index 090998ee..ca164b21 100644 --- a/include/znc/Client.h +++ b/include/znc/Client.h @@ -85,6 +85,7 @@ public: m_bNamesx = false; m_bUHNames = false; m_bAway = false; + m_bServerTime = false; EnableReadLine(); // RFC says a line can have 512 chars max, but we are // a little more gentle ;) @@ -151,6 +152,7 @@ protected: bool m_bNamesx; bool m_bUHNames; bool m_bAway; + bool m_bServerTime; CUser* m_pUser; CIRCNetwork* m_pNetwork; CString m_sNick; diff --git a/src/Client.cpp b/src/Client.cpp index 4773ab8f..75c0527f 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -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);