26 #pragma GCC visibility push(default)
34 :
CModule(NULL, pUser, pNetwork, sModName, sDataPath) {
35 m_perlObj = newSVsv(perlObj);
38 return sv_2mortal(newSVsv(m_perlObj));
61 virtual void OnMode2(
const CNick* pOpNick,
CChan& Channel,
char uMode,
const CString& sArg,
bool bAdded,
bool bNoChange);
68 virtual void OnQuit(
const CNick& Nick,
const CString& sMessage,
const std::vector<CChan*>& vChans);
69 virtual void OnNick(
const CNick& Nick,
const CString& sNewNick,
const std::vector<CChan*>& vChans);
123 :
CTimer (pModule, uInterval, uCycles, sLabel, sDescription), m_perlObj(newSVsv(perlObj)) {
128 return sv_2mortal(newSVsv(m_perlObj));
134 const CString& sLabel,
const CString& sDescription, SV* perlObj) {
135 return new CPerlTimer(pModule, uInterval, uCycles, sLabel, sDescription, perlObj);
143 return sv_2mortal(newSVsv(m_perlObj));
150 virtual void ReadData(
const char *data,
size_t len);
200 #pragma GCC visibility pop
virtual void OnRawMode2(const CNick *pOpNick, CChan &Channel, const CString &sModes, const CString &sArgs)
Called on any channel mode change.
const char * ZNC_VERSION_EXTRA
virtual bool OnEmbeddedWebRequest(CWebSock &, const CString &, CTemplate &)
Using this hook, module can embed web stuff directly to different places.
SV * GetPerlObj()
Definition: modperl/module.h:37
CPerlTimer(CPerlModule *pModule, unsigned int uInterval, unsigned int uCycles, const CString &sLabel, const CString &sDescription, SV *perlObj)
Definition: modperl/module.h:122
virtual void OnPostRehash()
This module hook is called after a successful rehash.
#define VERSION
Definition: version.h:8
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 void OnModCommand(const CString &sCommand)
Called when a command to your module is sent, e.g.
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 EModRet OnUserTopic(CString &sChannel, CString &sTopic)
This module hook is called when a user wants to change a channel topic.
virtual EModRet OnUserJoin(CString &sChannel, CString &sKey)
This hooks is called when a user sends a JOIN message.
virtual void OnJoin(const CNick &Nick, CChan &Channel)
Called when a nick joins a channel.
bool HaveSSL()
Definition: modperl/module.h:166
virtual EModRet OnUserRaw(CString &sLine)
This module hook is called when a client sends a raw traffic line to ZNC.
double GetVersion()
Definition: modperl/module.h:192
virtual void RunJob()
this is the method you should override
virtual void OnIRCConnected()
This module hook is called after a successful login to IRC.
virtual bool OnWebPreRequest(CWebSock &WebSock, const CString &sPageName)
For WebMods: Called before the list of registered SubPages will be checked.
virtual EModRet OnUserMsg(CString &sTarget, CString &sMessage)
This module hook is called when a user sends a normal IRC message.
virtual EModRet OnUserAction(CString &sTarget, CString &sMessage)
Called when a client sends a CTCP ACTION request ("/me").
Definition: modperl/module.h:28
virtual void OnKick(const CNick &OpNick, const CString &sKickedNick, CChan &Channel, const CString &sMessage)
Called when a nick is kicked from a channel.
virtual CString GetWebMenuTitle()
Return the title of the module's section in the web interface's side bar.
bool HaveIPv6()
Definition: modperl/module.h:159
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...
CPerlSocket * CreatePerlSocket(CPerlModule *pModule, SV *perlObj)
Definition: modperl/module.h:155
virtual EModRet OnUserCTCP(CString &sTarget, CString &sMessage)
This module hook is called when a client sends a CTCP request.
virtual EModRet OnTopic(CNick &Nick, CChan &Channel, CString &sTopic)
Called when we receive a channel topic change from IRC.
virtual VWebSubPages & GetSubPages()
Returns a list of all registered SubPages.
virtual bool WebRequiresAdmin()
Return true if this module should only be usable for admins on the web.
virtual bool OnBoot()
This module hook is called during ZNC startup.
std::vector< TWebSubPage > VWebSubPages
Definition: WebModules.h:31
virtual bool WebRequiresLogin()
Modules which can only be used with an active user session have to return true here.
Definition: modperl/module.h:119
virtual void OnOp2(const CNick *pOpNick, const CNick &Nick, CChan &Channel, bool bNoChange)
Called when a nick is opped on a channel.
CPerlSocket(CPerlModule *pModule, SV *perlObj)
Definition: modperl/module.h:141
Base Csock implementation to be used by modules.
Definition: Socket.h:164
Definition: modperl/module.h:114
virtual EModRet OnChanCTCP(CNick &Nick, CChan &Channel, CString &sMessage)
Called when we receive a channel CTCP request from IRC.
virtual EModRet OnUserPart(CString &sChannel, CString &sMessage)
This hooks is called when a user sends a PART message.
virtual void OnClientDisconnect()
Called when a client disconnected from ZNC.
Definition: modperl/module.h:116
Definition: Modules.h:135
virtual void OnModCTCP(const CString &sMessage)
Called when your module nick was sent a CTCP message.
CPerlModule(CUser *pUser, CIRCNetwork *pNetwork, const CString &sModName, const CString &sDataPath, SV *perlObj)
Definition: modperl/module.h:32
virtual void OnPreRehash()
Called just before znc.conf is rehashed.
CString GetVersionExtra()
Definition: modperl/module.h:196
virtual void OnModNotice(const CString &sMessage)
Called when a your module nick was sent a notice.
virtual EModRet OnSendToIRC(CString &sLine)
Called when ZNC sends a raw traffic line to the IRC server.
bool AddTimer(CTimer *pTimer)
virtual EModRet OnUserNotice(CString &sTarget, CString &sMessage)
This module hook is called when a user sends a notice message.
virtual EModRet OnUserTopicRequest(CString &sChannel)
This hook is called when a user requests a channel's topic.
virtual bool OnServerCapAvailable(const CString &sCap)
Called for every CAP received via CAP LS from server.
virtual void OnClientLogin()
Called when a client successfully logged in to ZNC.
virtual EModRet OnPrivCTCP(CNick &Nick, CString &sMessage)
Called when we receive a private CTCP request from IRC.
Basic socket class.
Definition: Csocket.h:537
Definition: Template.h:117
virtual void OnQuit(const CNick &Nick, const CString &sMessage, const std::vector< CChan * > &vChans)
Called when a nick quit from IRC.
Definition: IRCNetwork.h:36
virtual EModRet OnCTCPReply(CNick &Nick, CString &sMessage)
Called when we receive a CTCP reply from IRC.
String class that is used inside ZNC.
Definition: ZNCString.h:67
virtual EModRet OnSendToClient(CString &sLine, CClient &Client)
Called when ZNC sends a raw traffic line to a client.
virtual EModRet OnStatusCommand(CString &sCommand)
Called when a command to *status is sent.
virtual void ReadLine(const CString &sLine)
EModRet
This enum is just used for return from module hooks.
Definition: Modules.h:332
virtual EModRet OnChanBufferStarting(CChan &Chan, CClient &Client)
Called before a channel buffer is played back to a client.
The base class for your own ZNC modules.
Definition: Modules.h:322
#define VERSION_MINOR
Definition: version.h:6
virtual EModRet OnBroadcast(CString &sMessage)
This module hook is called when a message is broadcasted to all users.
virtual EModRet OnPrivBufferPlayLine(CClient &Client, CString &sLine)
Called when a line from the query buffer is played back.
virtual EModRet OnDeleteNetwork(CIRCNetwork &Network)
This module hook is called when a network is deleted.
Definition: WebModules.h:111
virtual EModRet OnPrivMsg(CNick &Nick, CString &sMessage)
Called when we receive a private message from IRC.
virtual void OnNick(const CNick &Nick, const CString &sNewNick, const std::vector< CChan * > &vChans)
Called when a nickname change occurs.
virtual EModRet OnIRCConnecting(CIRCSock *pIRCSock)
This module hook is called just before ZNC tries to establish a connection to an IRC server...
virtual EModRet OnUserCTCPReply(CString &sTarget, CString &sMessage)
This module hook is called when a client sends a CTCP reply.
int _GetSOMAXCONN()
Definition: modperl/module.h:180
virtual void Connected()
Override these functions for an easy interface when using the Socket Manager Don't bother using these...
virtual void OnIRCDisconnected()
This module hook is called when a user gets disconnected from IRC.
virtual EModRet OnPrivNotice(CNick &Nick, CString &sMessage)
Called when we receive a private notice.
SV * GetPerlObj()
Definition: modperl/module.h:127
virtual void OnIRCConnectionError(CIRCSock *pIRCSock)
This module hook is called when a CIRCSock fails to connect or a module returned HALTCORE from OnIRCC...
Definition: modperl/module.h:115
bool HaveCharset()
Definition: modperl/module.h:173
CPerlTimer * CreatePerlTimer(CPerlModule *pModule, unsigned int uInterval, unsigned int uCycles, const CString &sLabel, const CString &sDescription, SV *perlObj)
Definition: modperl/module.h:133
ELoadPerlMod
Definition: modperl/module.h:113
virtual void OnVoice2(const CNick *pOpNick, const CNick &Nick, CChan &Channel, bool bNoChange)
Called when a nick is voiced on a channel.
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)...
virtual EModRet OnChanNotice(CNick &Nick, CChan &Channel, CString &sMessage)
Called when we receive a channel notice.
virtual Csock * GetSockObj(const CString &sHost, unsigned short uPort)
int GetVersionMinor()
Definition: modperl/module.h:188
virtual void Disconnected()
Override these functions for an easy interface when using the Socket Manager Don't bother using these...
virtual EModRet OnChanBufferPlayLine(CChan &Chan, CClient &Client, CString &sLine)
Called when for each line during a channel's buffer play back.
int GetVersionMajor()
Definition: modperl/module.h:184
virtual EModRet OnRaw(CString &sLine)
Called on any raw IRC line received from the IRC server.
virtual EModRet OnChanMsg(CNick &Nick, CChan &Channel, CString &sMessage)
Called when we receive a channel message from IRC.
virtual EModRet OnChanAction(CNick &Nick, CChan &Channel, CString &sMessage)
Called when we receive a channel CTCP ACTION ("/me" in a channel) from IRC.
virtual EModRet OnIRCRegistration(CString &sPass, CString &sNick, CString &sIdent, CString &sRealName)
This module hook is called before loging in to the IRC server.
virtual void ConnectionRefused()
Override these functions for an easy interface when using the Socket Manager Don't bother using these...
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 OnPrivAction(CNick &Nick, CString &sMessage)
Called when we receive a private CTCP ACTION ("/me" in query) from IRC.
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 void OnDevoice2(const CNick *pOpNick, const CNick &Nick, CChan &Channel, bool bNoChange)
Called when a nick is devoiced on a channel.
Definition: modperl/module.h:138
SV * GetPerlObj()
Definition: modperl/module.h:142
virtual void Timeout()
Override these functions for an easy interface when using the Socket Manager Don't bother using these...
virtual EModRet OnAddNetwork(CIRCNetwork &Network, CString &sErrorRet)
This module hook is called when a network is being added.
virtual void OnPart(const CNick &Nick, CChan &Channel, const CString &sMessage)
Called when a nick parts a channel.
virtual void OnDeop2(const CNick *pOpNick, const CNick &Nick, CChan &Channel, bool bNoChange)
Called when a nick is deopped on a channel.
#define VERSION_MAJOR
Definition: version.h:5
virtual EModRet OnChanBufferEnding(CChan &Chan, CClient &Client)
Called after a channel buffer was played back to a client.