Add OnPrivBufferStarting/Ending signals, similar to Chan buffers

Allows hooking into query buffer playback before and after all the
lines of the query buffer are replayed. The EModRet return value
has no effect at the moment, but may be used in the future to e.g.
prevent playback. The Chan version of these signals use EModRet to
skip emitting the status message, but not the whole playback.
This commit is contained in:
Tor Arne Vestbø
2016-07-13 15:15:56 +02:00
parent 56620af107
commit 4d5724eb0a
3 changed files with 39 additions and 0 deletions

View File

@@ -44,6 +44,10 @@ void CQuery::SendBuffer(CClient* pClient, const CBuffer& Buffer) {
bool bWasPlaybackActive = pUseClient->IsPlaybackActive();
pUseClient->SetPlaybackActive(true);
NETWORKMODULECALL(OnPrivBufferStarting(*this, *pUseClient),
m_pNetwork->GetUser(), m_pNetwork, nullptr,
NOTHING);
bool bBatch = pUseClient->HasBatch();
CString sBatchName = m_sName.MD5();
@@ -82,6 +86,10 @@ void CQuery::SendBuffer(CClient* pClient, const CBuffer& Buffer) {
pUseClient);
}
NETWORKMODULECALL(OnPrivBufferEnding(*this, *pUseClient),
m_pNetwork->GetUser(), m_pNetwork, nullptr,
NOTHING);
pUseClient->SetPlaybackActive(bWasPlaybackActive);
if (pClient) break;