diff --git a/Chan.cpp b/Chan.cpp index fe059003..e6fef8b0 100644 --- a/Chan.cpp +++ b/Chan.cpp @@ -506,17 +506,29 @@ void CChan::SendBuffer(CClient* pClient) { const vector& vsBuffer = GetBuffer(); if (vsBuffer.size()) { - m_pUser->PutUser(":***!znc@znc.in PRIVMSG " + GetName() + " :Buffer Playback...", pClient); + bool bSkipStatusMsg = false; + MODULECALL(OnChanBufferStarting(*this, *pClient), m_pUser, NULL, bSkipStatusMsg = true); + + if (!bSkipStatusMsg) { + m_pUser->PutUser(":***!znc@znc.in PRIVMSG " + GetName() + " :Buffer Playback...", pClient); + } for (unsigned int a = 0; a < vsBuffer.size(); a++) { - m_pUser->PutUser(vsBuffer[a], pClient); + CString sLine(vsBuffer[a]); + MODULECALL(OnChanBufferPlayLine(*this, *pClient, sLine), m_pUser, NULL, continue); + m_pUser->PutUser(sLine, pClient); } if (!KeepBuffer()) { ClearBuffer(); } - m_pUser->PutUser(":***!znc@znc.in PRIVMSG " + GetName() + " :Playback Complete.", pClient); + bSkipStatusMsg = false; + MODULECALL(OnChanBufferEnding(*this, *pClient), m_pUser, NULL, bSkipStatusMsg = true); + + if (!bSkipStatusMsg) { + m_pUser->PutUser(":***!znc@znc.in PRIVMSG " + GetName() + " :Playback Complete.", pClient); + } } } } diff --git a/Modules.cpp b/Modules.cpp index c6a6c089..dd6cec02 100644 --- a/Modules.cpp +++ b/Modules.cpp @@ -498,6 +498,11 @@ void CModule::OnKick(const CNick& Nick, const CString& sKickedNick, CChan& Chann void CModule::OnJoin(const CNick& Nick, CChan& Channel) {} void CModule::OnPart(const CNick& Nick, CChan& Channel) {} +CModule::EModRet CModule::OnChanBufferStarting(CChan& Chan, CClient& Client) { return CONTINUE; } +CModule::EModRet CModule::OnChanBufferEnding(CChan& Chan, CClient& Client) { return CONTINUE; } +CModule::EModRet CModule::OnChanBufferPlayLine(CChan& Chan, CClient& Client, CString& sLine) { return CONTINUE; } +CModule::EModRet CModule::OnPrivBufferPlayLine(CClient& Client, CString& sLine) { return CONTINUE; } + void CModule::OnClientLogin() {} void CModule::OnClientDisconnect() {} CModule::EModRet CModule::OnUserRaw(CString& sLine) { return CONTINUE; } @@ -638,6 +643,10 @@ bool CModules::OnNick(const CNick& Nick, const CString& sNewNick, const vectorPutClient(sBufLine); }