Pass CMessage to buffer playback hooks

This commit is contained in:
J-P Nurmi
2015-07-13 17:44:48 +02:00
parent 8a7c79bb78
commit d0a58ff239
5 changed files with 53 additions and 19 deletions

View File

@@ -22,6 +22,7 @@
#include <znc/Server.h>
#include <znc/Chan.h>
#include <znc/Query.h>
#include <znc/Message.h>
#include <algorithm>
#include <memory>
@@ -642,11 +643,15 @@ void CIRCNetwork::ClientConnected(CClient *pClient) {
uSize = m_NoticeBuffer.Size();
for (uIdx = 0; uIdx < uSize; uIdx++) {
const CBufLine& BufLine = m_NoticeBuffer.GetBufLine(uIdx);
CString sLine = BufLine.GetLine(*pClient, msParams);
CMessage Message(BufLine.GetLine(*pClient, msParams));
Message.SetNetwork(this);
Message.SetClient(pClient);
Message.SetTime(BufLine.GetTime());
Message.SetTags(BufLine.GetTags());
bool bContinue = false;
NETWORKMODULECALL(OnPrivBufferPlayLine2(*pClient, sLine, BufLine.GetTime()), m_pUser, this, nullptr, &bContinue);
NETWORKMODULECALL(OnPrivBufferPlayMessage(Message), m_pUser, this, nullptr, &bContinue);
if (bContinue) continue;
pClient->PutClient(sLine);
pClient->PutClient(Message);
}
m_NoticeBuffer.Clear();