From: <ps...@us...> - 2010-02-03 14:47:05
|
Revision: 1730 http://znc.svn.sourceforge.net/znc/?rev=1730&view=rev Author: psychon Date: 2010-02-03 14:46:57 +0000 (Wed, 03 Feb 2010) Log Message: ----------- 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. Modified Paths: -------------- trunk/IRCSock.cpp trunk/Modules.h Modified: trunk/IRCSock.cpp =================================================================== --- trunk/IRCSock.cpp 2010-02-02 17:36:18 UTC (rev 1729) +++ trunk/IRCSock.cpp 2010-02-03 14:46:57 UTC (rev 1730) @@ -761,15 +761,16 @@ 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)) Modified: trunk/Modules.h =================================================================== --- trunk/Modules.h 2010-02-02 17:36:18 UTC (rev 1729) +++ trunk/Modules.h 2010-02-03 14:46:57 UTC (rev 1730) @@ -556,12 +556,14 @@ */ virtual EModRet OnChanCTCP(CNick& Nick, CChan& Channel, CString& sMessage); /** Called when we receive a private CTCP ACTION ("/me" in query) <em>from IRC</em>. + * 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) <em>from IRC</em>. + * 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |