Added OnTimerAutoJoin(). Patch from Freman. Thanks :)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1272 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
silverleo
2008-11-25 10:53:40 +00:00
parent c71565103c
commit 9952e8d2c5
5 changed files with 12 additions and 0 deletions
+2
View File
@@ -497,6 +497,7 @@ CModule::EModRet CModule::OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessa
CModule::EModRet CModule::OnPrivNotice(CNick& Nick, CString& sMessage) { return CONTINUE; }
CModule::EModRet CModule::OnChanNotice(CNick& Nick, CChan& Channel, CString& sMessage) { return CONTINUE; }
CModule::EModRet CModule::OnTopic(CNick& Nick, CChan& Channel, CString& sTopic) { return CONTINUE; }
CModule::EModRet CModule::OnTimerAutoJoin(CChan& Channel) { return CONTINUE; }
void* CModule::GetDLL() { return m_pDLL; }
bool CModule::PutIRC(const CString& sLine) {
@@ -622,6 +623,7 @@ bool CModules::OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) { MODHA
bool CModules::OnPrivNotice(CNick& Nick, CString& sMessage) { MODHALTCHK(OnPrivNotice(Nick, sMessage)); }
bool CModules::OnChanNotice(CNick& Nick, CChan& Channel, CString& sMessage) { MODHALTCHK(OnChanNotice(Nick, Channel, sMessage)); }
bool CModules::OnTopic(CNick& Nick, CChan& Channel, CString& sTopic) { MODHALTCHK(OnTopic(Nick, Channel, sTopic)); }
bool CModules::OnTimerAutoJoin(CChan& Channel) { MODHALTCHK(OnTimerAutoJoin(Channel)); }
bool CModules::OnStatusCommand(CString& sCommand) { MODHALTCHK(OnStatusCommand(sCommand)); }
bool CModules::OnModCommand(const CString& sCommand) { MODUNLOADCHK(OnModCommand(sCommand)); return false; }
bool CModules::OnModNotice(const CString& sMessage) { MODUNLOADCHK(OnModNotice(sMessage)); return false; }
+2
View File
@@ -280,6 +280,7 @@ public:
virtual EModRet OnPrivNotice(CNick& Nick, CString& sMessage);
virtual EModRet OnChanNotice(CNick& Nick, CChan& Channel, CString& sMessage);
virtual EModRet OnTopic(CNick& Nick, CChan& Channel, CString& sTopic);
virtual EModRet OnTimerAutoJoin(CChan& Channel);
void * GetDLL();
static double GetCoreVersion() { return VERSION; }
@@ -422,6 +423,7 @@ public:
virtual bool OnPrivNotice(CNick& Nick, CString& sMessage);
virtual bool OnChanNotice(CNick& Nick, CChan& Channel, CString& sMessage);
virtual bool OnTopic(CNick& Nick, CChan& Channel, CString& sTopic);
virtual bool OnTimerAutoJoin(CChan& Channel);
CModule* FindModule(const CString& sModule) const;
bool LoadModule(const CString& sModule, const CString& sArgs, CUser* pUser, CString& sRetMsg, bool bFake = false);
+2
View File
@@ -669,6 +669,8 @@ void CUser::JoinChans() {
pChan->Disable();
} else {
pChan->IncJoinTries();
MODULECALL(OnTimerAutoJoin(*pChan), this, NULL, continue);
PutIRC("JOIN " + pChan->GetName() + " " + pChan->GetKey());
// Limit the number of joins
+1
View File
@@ -336,6 +336,7 @@ public:
virtual EModRet OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName) {
return(CBFour("OnIRCRegistration", sPass, sNick, sIdent, sRealName));
}
virtual EModRet OnTimerAutoJoin(CChan& Channel) { return(CBSingle("OnTimerAutoJoin", CHAN(Channel))); }
virtual void OnModCommand(const CString& sCommand)
{
+5
View File
@@ -105,6 +105,11 @@ public:
PutModule("* Quits: " + Nick.GetNick() + " (" + Nick.GetIdent() + "!" + Nick.GetHost() + ") (" + sMessage + ")");
}
virtual EModRet OnTimerAutoJoin(CChan& Channel) {
PutModule("Attempting to join " + Channel.GetName());
return CONTINUE;
}
virtual void OnJoin(const CNick& Nick, CChan& Channel) {
PutModule("* Joins: " + Nick.GetNick() + " (" + Nick.GetIdent() + "!" + Nick.GetHost() + ")");
}