From c46616376a1b72b320054531becf25c8884003f2 Mon Sep 17 00:00:00 2001 From: psychon Date: Wed, 3 Feb 2010 14:46:57 +0000 Subject: [PATCH] Call OnChanAction() after OnChanCTCP() Now these two module hooks are called in the same order as OnPrivAction() and OnPrivCTCP(). Additionally, one can now properly block channel action's from reaching the channel buffer via return HALTCORE; in OnChanAction. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1730 726aef4b-f618-498e-8847-2d620e286838 --- IRCSock.cpp | 5 +++-- Modules.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/IRCSock.cpp b/IRCSock.cpp index 30a257fa..7cde49ce 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -761,15 +761,16 @@ bool CIRCSock::OnPrivMsg(CNick& Nick, CString& sMessage) { bool CIRCSock::OnChanCTCP(CNick& Nick, const CString& sChan, CString& sMessage) { CChan* pChan = m_pUser->FindChan(sChan); if (pChan) { + MODULECALL(OnChanCTCP(Nick, *pChan, sMessage), m_pUser, NULL, return true); + // Record a /me if (sMessage.TrimPrefix("ACTION ")) { + MODULECALL(OnChanAction(Nick, *pChan, sMessage), m_pUser, NULL, return true); if (pChan->KeepBuffer() || !m_pUser->IsUserAttached() || pChan->IsDetached()) { pChan->AddBuffer(":" + Nick.GetNickMask() + " PRIVMSG " + sChan + " :\001ACTION " + m_pUser->AddTimestamp(sMessage) + "\001"); } - MODULECALL(OnChanAction(Nick, *pChan, sMessage), m_pUser, NULL, return true); sMessage = "ACTION " + sMessage; } - MODULECALL(OnChanCTCP(Nick, *pChan, sMessage), m_pUser, NULL, return true); } if (OnGeneralCTCP(Nick, sMessage)) diff --git a/Modules.h b/Modules.h index ac1c677c..2cfc5b38 100644 --- a/Modules.h +++ b/Modules.h @@ -556,12 +556,14 @@ public: */ virtual EModRet OnChanCTCP(CNick& Nick, CChan& Channel, CString& sMessage); /** Called when we receive a private CTCP ACTION ("/me" in query) from IRC. + * This is called after CModule::OnPrivCTCP(). * @param Nick The nick the action came from. * @param sMessage The action message * @return See CModule::EModRet. */ virtual EModRet OnPrivAction(CNick& Nick, CString& sMessage); /** Called when we receive a channel CTCP ACTION ("/me" in a channel) from IRC. + * This is called after CModule::OnChanCTCP(). * @param Nick The nick the action came from. * @param Channel The channel the action was sent to. * @param sMessage The action message