diff --git a/include/znc/Chan.h b/include/znc/Chan.h index 5295ee0a..c2eda582 100644 --- a/include/znc/Chan.h +++ b/include/znc/Chan.h @@ -96,6 +96,7 @@ public: size_t AddBuffer(const CString& sFormat, const CString& sText = "", const timeval* ts = NULL) { return m_Buffer.AddLine(sFormat, sText, ts); } void ClearBuffer() { m_Buffer.Clear(); } void SendBuffer(CClient* pClient); + void SendBuffer(CClient* pClient, const CBuffer& Buffer); // !Buffer // m_Nick wrappers diff --git a/src/Chan.cpp b/src/Chan.cpp index ec9d0d67..f7946e0a 100644 --- a/src/Chan.cpp +++ b/src/Chan.cpp @@ -526,6 +526,10 @@ CNick* CChan::FindNick(const CString& sNick) { } void CChan::SendBuffer(CClient* pClient) { + SendBuffer(pClient, m_Buffer); +} + +void CChan::SendBuffer(CClient* pClient, const CBuffer& Buffer) { if (m_pNetwork && m_pNetwork->IsUserAttached()) { // in the event that pClient is NULL, need to send this to all clients for the user // I'm presuming here that pClient is listed inside vClients thus vClients at this @@ -541,7 +545,7 @@ void CChan::SendBuffer(CClient* pClient) { // if pClient is not NULL, the loops break after the first iteration. // // Rework this if you like ... - if (!m_Buffer.IsEmpty()) { + if (!Buffer.IsEmpty()) { const vector & vClients = m_pNetwork->GetClients(); for (size_t uClient = 0; uClient < vClients.size(); ++uClient) { CClient * pUseClient = (pClient ? pClient : vClients[uClient]); @@ -553,9 +557,9 @@ void CChan::SendBuffer(CClient* pClient) { m_pNetwork->PutUser(":***!znc@znc.in PRIVMSG " + GetName() + " :Buffer Playback...", pUseClient); } - size_t uSize = m_Buffer.Size(); + size_t uSize = Buffer.Size(); for (size_t uIdx = 0; uIdx < uSize; uIdx++) { - CString sLine = m_Buffer.GetLine(uIdx, *pUseClient); + CString sLine = Buffer.GetLine(uIdx, *pUseClient); bool bNotShowThisLine = false; NETWORKMODULECALL(OnChanBufferPlayLine(*this, *pUseClient, sLine), m_pNetwork->GetUser(), m_pNetwork, NULL, &bNotShowThisLine); if (bNotShowThisLine) continue;