Server part of CAP stuff

This introduces the code for modules to request CAPs on the IRC server. They
will get a callback when the capability was accepted or rejected.

Thanks to DarthGandalf for this patch. This should turn DarthGandalf and tomaw
into happy znc users again. ;)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2099 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-08-04 18:50:44 +00:00
parent 3dd57bdf06
commit 83db7684f2
4 changed files with 114 additions and 33 deletions
+19
View File
@@ -638,6 +638,21 @@ public:
*/
virtual EModRet OnTopic(CNick& Nick, CChan& Channel, CString& sTopic);
/** Called for every CAP received via CAP LS from server.
* @param sCap capability supported by server.
* @return true if your module supports this CAP and
* needs to turn it on with CAP REQ.
*/
virtual bool OnServerCapAvailable(const CString& sCap);
/** Called for every CAP accepted by server (with CAP ACK after our CAP REQ).
* @param sCap capability accepted by server.
*/
virtual void OnServerCapAccepted(const CString& sCap);
/** Called for every CAP rejected by server (with CAP NAK after our CAP REQ).
* @param sCap capability rejected by server.
*/
virtual void OnServerCapRejected(const CString& sCap);
/** This module hook is called just before ZNC tries to join a channel
* by itself because it's in the config but wasn't joined yet.
* @param Channel The channel which will be joined.
@@ -868,6 +883,10 @@ public:
bool OnTopic(CNick& Nick, CChan& Channel, CString& sTopic);
bool OnTimerAutoJoin(CChan& Channel);
bool OnServerCapAvailable(const CString& sCap);
bool OnServerCapAccepted(const CString& sCap);
bool OnServerCapRejected(const CString& sCap);
CModule* FindModule(const CString& sModule) const;
bool LoadModule(const CString& sModule, const CString& sArgs, CUser* pUser, CString& sRetMsg);
bool UnloadModule(const CString& sModule);