Add OnTopic() module call

Thanks to SilverLeo, again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1011 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-04-01 09:03:17 +00:00
parent 3be33dd6c8
commit 0a5d3013d2
4 changed files with 13 additions and 0 deletions
+3
View File
@@ -655,6 +655,9 @@ void CIRCSock::ReadLine(const CString& sData) {
if (pChan) {
CString sTopic = sLine.Token(3, true);
sTopic.LeftChomp();
MODULECALL(OnTopic(Nick, *pChan, sTopic), m_pUser, NULL, return)
pChan->SetTopicOwner(Nick.GetNick());
pChan->SetTopicDate((unsigned long) time(NULL));
pChan->SetTopic(sTopic);
+2
View File
@@ -529,6 +529,7 @@ CModule::EModRet CModule::OnPrivMsg(CNick& Nick, CString& sMessage) { return CON
CModule::EModRet CModule::OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) { return CONTINUE; }
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; }
void* CModule::GetDLL() { return m_pDLL; }
bool CModule::PutIRC(const CString& sLine) {
@@ -627,6 +628,7 @@ bool CModules::OnPrivMsg(CNick& Nick, CString& sMessage) { MODHALTCHK(OnPrivMsg(
bool CModules::OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) { MODHALTCHK(OnChanMsg(Nick, Channel, sMessage)); }
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::OnStatusCommand(const 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
@@ -272,6 +272,7 @@ public:
virtual EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage);
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);
void * GetDLL();
static double GetCoreVersion() { return VERSION; }
@@ -407,6 +408,7 @@ public:
virtual bool OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage);
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);
CModule* FindModule(const CString& sModule) const;
bool LoadModule(const CString& sModule, const CString& sArgs, CUser* pUser, CString& sRetMsg, bool bFake = false);
+6
View File
@@ -165,6 +165,12 @@ public:
return CONTINUE;
}
virtual EModRet OnTopic(CNick& Nick, CChan& Channel, CString& sTopic) {
PutModule("* " + Nick.GetNick() + " changes topic on " + Channel.GetName() + " to '" + sTopic + "'");
return CONTINUE;
}
virtual EModRet OnUserMsg(CString& sTarget, CString& sMessage) {
PutModule("[" + sTarget + "] usermsg [" + sMessage + "]");
sMessage = "Sample: \0034" + sMessage + "\003";