mirror of
https://github.com/znc/znc.git
synced 2026-08-11 03:12:50 +02:00
Add module calls for client CAPs
This commit adds new module calls which make it possibly to announce new capabilities from a module. Thanks to DarthGandalf for the patch and for not going mad from my comments. :) git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2071 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -959,6 +959,24 @@ public:
|
||||
* (Well, ok, m_pUser isn't known yet...)
|
||||
*/
|
||||
virtual EModRet OnUnknownUserRaw(CClient* pClient, CString& sLine);
|
||||
|
||||
/** Called when a client told us CAP LS. Use ssCaps.insert("cap-name")
|
||||
* for announcing capabilities which your module supports.
|
||||
* @param pClient client which wants caps.
|
||||
*/
|
||||
virtual void OnClientCapLs(SCString& ssCaps);
|
||||
/** Called only to check if your module supports turning on/off named capability.
|
||||
* @param sCap name of capability.
|
||||
* @param bState On or off, depending on which case is interesting for client.
|
||||
* @return true if your module supports this capability in the specified state.
|
||||
*/
|
||||
virtual bool IsClientCapSupported(const CString& sCap, bool bState);
|
||||
/** Called when we actually need to turn a capability on or off for a client.
|
||||
* @param pClient client which requested this.
|
||||
* @param sCap name of wanted capability.
|
||||
* @param bState On or off, depending on which case client needs.
|
||||
*/
|
||||
virtual void OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState);
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -974,6 +992,9 @@ public:
|
||||
bool OnLoginAttempt(CSmartPtr<CAuthBase> Auth);
|
||||
void OnFailedLogin(const CString& sUsername, const CString& sRemoteIP);
|
||||
bool OnUnknownUserRaw(CClient* pClient, CString& sLine);
|
||||
void OnClientCapLs(SCString& ssCaps);
|
||||
bool IsClientCapSupported(const CString& sCap, bool bState);
|
||||
void OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState);
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user