27 #pragma GCC visibility push(default)
31 CModPython* m_pModPython;
35 PyObject* pyObj, CModPython* pModPython)
36 :
CModule(NULL, pUser, pNetwork, sModName, sDataPath) {
39 m_pModPython = pModPython;
77 virtual void OnMode2(
const CNick* pOpNick,
CChan& Channel,
char uMode,
const CString& sArg,
bool bAdded,
bool bNoChange);
84 virtual void OnQuit(
const CNick& Nick,
const CString& sMessage,
const std::vector<CChan*>& vChans);
85 virtual void OnNick(
const CNick& Nick,
const CString& sNewNick,
const std::vector<CChan*>& vChans);
136 bool& bSuccess,
CString& sRetMsg);
147 return new CPyModule(pUser, pNetwork, sModName, sDataPath, pyObj, pModPython);
152 CModPython* m_pModPython;
155 :
CTimer (pModule, uInterval, uCycles, sLabel, sDescription), m_pyObj(pyObj) {
170 const CString& sLabel,
const CString& sDescription, PyObject* pyObj) {
171 return new CPyTimer(pModule, uInterval, uCycles, sLabel, sDescription, pyObj);
176 CModPython* m_pModPython;
192 virtual void ReadData(
const char *data,
size_t len);
245 MCString::iterator
x;
262 m_it = pModules->begin();
282 #pragma GCC visibility pop
virtual void OnIRCConnectionError(CIRCSock *pIRCSock)
This module hook is called when a CIRCSock fails to connect or a module returned HALTCORE from OnIRCC...
CPyTimer(CPyModule *pModule, unsigned int uInterval, unsigned int uCycles, const CString &sLabel, const CString &sDescription, PyObject *pyObj)
Definition: modpython/module.h:154
virtual void OnPreRehash()
Called just before znc.conf is rehashed.
const char * ZNC_VERSION_EXTRA
virtual void OnDevoice2(const CNick *pOpNick, const CNick &Nick, CChan &Channel, bool bNoChange)
Called when a nick is devoiced on a channel.
virtual bool OnEmbeddedWebRequest(CWebSock &, const CString &, CTemplate &)
Using this hook, module can embed web stuff directly to different places.
CPyTimer * CreatePyTimer(CPyModule *pModule, unsigned int uInterval, unsigned int uCycles, const CString &sLabel, const CString &sDescription, PyObject *pyObj)
Definition: modpython/module.h:169
virtual void Connected()
Override these functions for an easy interface when using the Socket Manager Don't bother using these...
#define VERSION
Definition: version.h:8
virtual void OnDeop2(const CNick *pOpNick, const CNick &Nick, CChan &Channel, bool bNoChange)
Called when a nick is deopped on a channel.
virtual void OnGetAvailableMods(std::set< CModInfo > &ssMods, CModInfo::EModuleType eType)
Called when list of available mods is requested.
virtual EModRet OnGetModInfo(CModInfo &ModInfo, const CString &sModule, bool &bSuccess, CString &sRetMsg)
Called when info about a module is needed.
CModules * m_pModules
Definition: modpython/module.h:277
virtual void OnClientDisconnect()
Called when a client disconnected from ZNC.
virtual EModRet OnUnknownUserRaw(CClient *pClient, CString &sLine)
This function behaves like CModule::OnRaw(), but is also called before the client successfully logged...
EModuleType
Definition: Modules.h:184
virtual EModRet OnUserRaw(CString &sLine)
This module hook is called when a client sends a raw traffic line to ZNC.
virtual EModRet OnLoginAttempt(CSmartPtr< CAuthBase > Auth)
This module hook is called when a client tries to login.
virtual void OnClientLogin()
Called when a client successfully logged in to ZNC.
virtual void OnClientConnect(CZNCSock *pSock, const CString &sHost, unsigned short uPort)
This module hook is called when there is an incoming connection on any of ZNC's listening sockets...
Definition: modpython/module.h:242
CModPython * GetModPython()
Definition: modpython/module.h:53
CPyModule * CreatePyModule(CUser *pUser, CIRCNetwork *pNetwork, const CString &sModName, const CString &sDataPath, PyObject *pyObj, CModPython *pModPython)
Definition: modpython/module.h:146
virtual void ReadData(const char *data, size_t len)
Override these functions for an easy interface when using the Socket Manager Don't bother using these...
double GetVersion()
Definition: modperl/module.h:192
virtual EModRet OnAddUser(CUser &User, CString &sErrorRet)
This module hook is called when a user is being added.
virtual EModRet OnUserAction(CString &sTarget, CString &sMessage)
Called when a client sends a CTCP ACTION request ("/me").
virtual EModRet OnPrivMsg(CNick &Nick, CString &sMessage)
Called when we receive a private message from IRC.
bool HaveCharset_()
Definition: modpython/module.h:215
virtual CString GetWebMenuTitle()
Return the title of the module's section in the web interface's side bar.
CString GetPyExceptionStr()
virtual void Timeout()
Override these functions for an easy interface when using the Socket Manager Don't bother using these...
virtual bool OnWebRequest(CWebSock &WebSock, const CString &sPageName, CTemplate &Tmpl)
If OnWebPreRequest returned false, and the RequiresAdmin/IsAdmin check has been passed, this method will be called with the page name.
virtual Csock * GetSockObj(const CString &sHost, unsigned short uPort)
bool is_end() const
Definition: modpython/module.h:273
virtual EModRet OnChanBufferPlayLine(CChan &Chan, CClient &Client, CString &sLine)
Called when for each line during a channel's buffer play back.
virtual EModRet OnUserPart(CString &sChannel, CString &sMessage)
This hooks is called when a user sends a PART message.
PyObject * GetNewPyObj()
Definition: modpython/module.h:183
virtual void ConnectionRefused()
Override these functions for an easy interface when using the Socket Manager Don't bother using these...
CModules::const_iterator m_it
Definition: modpython/module.h:278
virtual void OnMode2(const CNick *pOpNick, CChan &Channel, char uMode, const CString &sArg, bool bAdded, bool bNoChange)
Called on an individual channel mode change.
virtual bool OnBoot()
This module hook is called during ZNC startup.
virtual EModRet OnUserTopic(CString &sChannel, CString &sTopic)
This module hook is called when a user wants to change a channel topic.
Definition: modpython/module.h:174
bool HaveSSL_()
Definition: modpython/module.h:208
Definition: Modules.h:1066
virtual EModRet OnChanNotice(CNick &Nick, CChan &Channel, CString &sMessage)
Called when we receive a channel notice.
virtual EModRet OnTopic(CNick &Nick, CChan &Channel, CString &sTopic)
Called when we receive a channel topic change from IRC.
CPySocket(CPyModule *pModule, PyObject *pyObj)
Definition: modpython/module.h:178
Definition: modpython/module.h:19
Definition: modpython/module.h:150
Definition: modpython/module.h:29
std::vector< TWebSubPage > VWebSubPages
Definition: WebModules.h:31
virtual void OnModCTCP(const CString &sMessage)
Called when your module nick was sent a CTCP message.
std::set< CString > SCString
Definition: ZNCString.h:34
virtual void OnRawMode2(const CNick *pOpNick, CChan &Channel, const CString &sModes, const CString &sArgs)
Called on any channel mode change.
virtual void OnPostRehash()
This module hook is called after a successful rehash.
Base Csock implementation to be used by modules.
Definition: Socket.h:164
virtual EModRet OnStatusCommand(CString &sCommand)
Called when a command to *status is sent.
virtual void OnVoice2(const CNick *pOpNick, const CNick &Nick, CChan &Channel, bool bNoChange)
Called when a nick is voiced on a channel.
Definition: Modules.h:135
virtual void OnIRCConnected()
This module hook is called after a successful login to IRC.
CString GetVersionExtra()
Definition: modperl/module.h:196
virtual VWebSubPages & GetSubPages()
Returns a list of all registered SubPages.
bool AddTimer(CTimer *pTimer)
virtual bool IsClientCapSupported(CClient *pClient, const CString &sCap, bool bState)
Called only to check if your module supports turning on/off named capability.
virtual EModRet OnTimerAutoJoin(CChan &Channel)
This module hook is called just before ZNC tries to join a channel by itself because it's in the conf...
virtual EModRet OnBroadcast(CString &sMessage)
This module hook is called when a message is broadcasted to all users.
PyObject * GetNewPyObj()
Definition: modpython/module.h:44
void DeletePyModule()
Definition: modpython/module.h:48
CPySocket * CreatePySocket(CPyModule *pModule, PyObject *pyObj)
Definition: modpython/module.h:197
Basic socket class.
Definition: Csocket.h:537
Definition: Template.h:117
PyObject * GetNewPyObj()
Definition: modpython/module.h:162
virtual EModRet OnSendToClient(CString &sLine, CClient &Client)
Called when ZNC sends a raw traffic line to a client.
virtual EModRet OnAddNetwork(CIRCNetwork &Network, CString &sErrorRet)
This module hook is called when a network is being added.
Definition: IRCNetwork.h:36
virtual EModRet OnIRCRegistration(CString &sPass, CString &sNick, CString &sIdent, CString &sRealName)
This module hook is called before loging in to the IRC server.
virtual EModRet OnUserCTCP(CString &sTarget, CString &sMessage)
This module hook is called when a client sends a CTCP request.
virtual EModRet OnPrivNotice(CNick &Nick, CString &sMessage)
Called when we receive a private notice.
void plusplus()
Definition: modpython/module.h:265
virtual void OnKick(const CNick &OpNick, const CString &sKickedNick, CChan &Channel, const CString &sMessage)
Called when a nick is kicked from a channel.
PyObject * GetPyObj()
Definition: modpython/module.h:41
String class that is used inside ZNC.
Definition: ZNCString.h:67
virtual void OnOp2(const CNick *pOpNick, const CNick &Nick, CChan &Channel, bool bNoChange)
Called when a nick is opped on a channel.
virtual void OnModCommand(const CString &sCommand)
Called when a command to your module is sent, e.g.
virtual void Disconnected()
Override these functions for an easy interface when using the Socket Manager Don't bother using these...
virtual bool OnWebPreRequest(CWebSock &WebSock, const CString &sPageName)
For WebMods: Called before the list of registered SubPages will be checked.
EModRet
This enum is just used for return from module hooks.
Definition: Modules.h:332
virtual void OnServerCapResult(const CString &sCap, bool bSuccess)
Called for every CAP accepted or rejected by server (with CAP ACK or CAP NAK after our CAP REQ)...
int GetSOMAXCONN()
Definition: modpython/module.h:222
virtual void OnPart(const CNick &Nick, CChan &Channel, const CString &sMessage)
Called when a nick parts a channel.
Definition: Modules.h:180
MCString_iter()
Definition: modpython/module.h:244
virtual EModRet OnUserNotice(CString &sTarget, CString &sMessage)
This module hook is called when a user sends a notice message.
The base class for your own ZNC modules.
Definition: Modules.h:322
virtual bool OnServerCapAvailable(const CString &sCap)
Called for every CAP received via CAP LS from server.
#define VERSION_MINOR
Definition: version.h:6
virtual EModRet OnUserCTCPReply(CString &sTarget, CString &sMessage)
This module hook is called when a client sends a CTCP reply.
virtual EModRet OnDeleteUser(CUser &User)
This module hook is called when a user is deleted.
CModulesIter(CModules *pModules)
Definition: modpython/module.h:260
virtual void OnFailedLogin(const CString &sUsername, const CString &sRemoteIP)
Called after a client login was rejected.
CPyModule(CUser *pUser, CIRCNetwork *pNetwork, const CString &sModName, const CString &sDataPath, PyObject *pyObj, CModPython *pModPython)
Definition: modpython/module.h:34
virtual EModRet OnUserJoin(CString &sChannel, CString &sKey)
This hooks is called when a user sends a JOIN message.
virtual EModRet OnModuleUnloading(CModule *pModule, bool &bSuccess, CString &sRetMsg)
Called when a module is going to be unloaded.
MCString::iterator EndNV()
Definition: Modules.h:914
Definition: WebModules.h:111
virtual EModRet OnChanBufferEnding(CChan &Chan, CClient &Client)
Called after a channel buffer was played back to a client.
virtual bool WebRequiresAdmin()
Return true if this module should only be usable for admins on the web.
virtual EModRet OnPrivBufferPlayLine(CClient &Client, CString &sLine)
Called when a line from the query buffer is played back.
virtual EModRet OnChanAction(CNick &Nick, CChan &Channel, CString &sMessage)
Called when we receive a channel CTCP ACTION ("/me" in a channel) from IRC.
virtual void OnIRCDisconnected()
This module hook is called when a user gets disconnected from IRC.
virtual void OnNick(const CNick &Nick, const CString &sNewNick, const std::vector< CChan * > &vChans)
Called when a nickname change occurs.
virtual EModRet OnChanBufferStarting(CChan &Chan, CClient &Client)
Called before a channel buffer is played back to a client.
virtual void OnClientCapRequest(CClient *pClient, const CString &sCap, bool bState)
Called when we actually need to turn a capability on or off for a client.
virtual EModRet OnChanMsg(CNick &Nick, CChan &Channel, CString &sMessage)
Called when we receive a channel message from IRC.
void plusplus()
Definition: modpython/module.h:247
virtual EModRet OnModuleLoading(const CString &sModName, const CString &sArgs, CModInfo::EModuleType eType, bool &bSuccess, CString &sRetMsg)
Called when a module is going to be loaded.
virtual void OnQuit(const CNick &Nick, const CString &sMessage, const std::vector< CChan * > &vChans)
Called when a nick quit from IRC.
virtual void OnModNotice(const CString &sMessage)
Called when a your module nick was sent a notice.
virtual EModRet OnCTCPReply(CNick &Nick, CString &sMessage)
Called when we receive a CTCP reply from IRC.
int GetVersionMinor()
Definition: modperl/module.h:188
virtual EModRet OnUserMsg(CString &sTarget, CString &sMessage)
This module hook is called when a user sends a normal IRC message.
MCString::iterator x
Definition: modpython/module.h:245
CString s
Definition: modpython/module.h:21
virtual void OnChanPermission2(const CNick *pOpNick, const CNick &Nick, CChan &Channel, unsigned char uMode, bool bAdded, bool bNoChange)
This module hook is called when a user mode on a channel changes.
virtual void OnJoin(const CNick &Nick, CChan &Channel)
Called when a nick joins a channel.
int GetVersionMajor()
Definition: modperl/module.h:184
virtual EModRet OnRaw(CString &sLine)
Called on any raw IRC line received from the IRC server.
Definition: modpython/module.h:258
virtual EModRet OnSendToIRC(CString &sLine)
Called when ZNC sends a raw traffic line to the IRC server.
virtual bool WebRequiresLogin()
Modules which can only be used with an active user session have to return true here.
virtual void ReadLine(const CString &sLine)
virtual EModRet OnPrivAction(CNick &Nick, CString &sMessage)
Called when we receive a private CTCP ACTION ("/me" in query) from IRC.
virtual EModRet OnUserTopicRequest(CString &sChannel)
This hook is called when a user requests a channel's topic.
bool is_end(CModule *m)
Definition: modpython/module.h:253
virtual EModRet OnChanCTCP(CNick &Nick, CChan &Channel, CString &sMessage)
Called when we receive a channel CTCP request from IRC.
virtual void OnClientCapLs(CClient *pClient, SCString &ssCaps)
Called when a client told us CAP LS.
MCString_iter(MCString::iterator z)
Definition: modpython/module.h:246
virtual void RunJob()
this is the method you should override
virtual EModRet OnIRCConnecting(CIRCSock *pIRCSock)
This module hook is called just before ZNC tries to establish a connection to an IRC server...
PyObject * GetPyObj()
Definition: modpython/module.h:161
virtual EModRet OnPrivCTCP(CNick &Nick, CString &sMessage)
Called when we receive a private CTCP request from IRC.
virtual EModRet OnDeleteNetwork(CIRCNetwork &Network)
This module hook is called when a network is deleted.
#define VERSION_MAJOR
Definition: version.h:5
PyObject * GetPyObj()
Definition: modpython/module.h:182
bool HaveIPv6_()
Definition: modpython/module.h:201