clearbufferonmsg: handle query buffers

This commit is contained in:
J-P Nurmi
2014-07-25 21:23:43 +02:00
parent 2d532fb8b9
commit 46bd6b05b2

View File

@@ -16,6 +16,7 @@
#include <znc/IRCNetwork.h>
#include <znc/Chan.h>
#include <znc/Query.h>
using std::vector;
@@ -26,9 +27,8 @@ public:
void ClearAllBuffers() {
if (m_pNetwork) {
const vector<CChan*>& vChans = m_pNetwork->GetChans();
vector<CChan*>::const_iterator it;
for (it = vChans.begin(); it != vChans.end(); ++it) {
for (vector<CChan*>::const_iterator it = vChans.begin(); it != vChans.end(); ++it) {
// Skip detached channels, they weren't read yet
if ((*it)->IsDetached())
continue;
@@ -38,6 +38,12 @@ public:
// doesn't make any sense with it
(*it)->SetAutoClearChanBuffer(false);
}
vector<CQuery*> VQueries = m_pNetwork->GetQueries();
for (vector<CQuery*>::const_iterator it = VQueries.begin(); it != VQueries.end(); ++it) {
m_pNetwork->DelQuery((*it)->GetName());
}
}
}
@@ -76,4 +82,4 @@ template<> void TModInfo<CClearBufferOnMsgMod>(CModInfo& Info) {
Info.SetWikiPage("clearbufferonmsg");
}
USERMODULEDEFS(CClearBufferOnMsgMod, "Clear all channel buffers whenever the user does something")
USERMODULEDEFS(CClearBufferOnMsgMod, "Clear all channel and query buffers whenever the user does something")