mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
Add new global setting MaxBufferSize
Previously, /znc setbuffer had a hardcoded limit of 500, other ways of setting the buffer size didn't have any limit built-in. This patch makes that limit configurable and makes sure the various places honour it. Thanks to DarthGandalf for the idea with the bForce argument, I were too small-minded to come up with it myself. :( git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2020 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -71,7 +71,7 @@ bool CChan::WriteConfig(CFile& File) {
|
||||
|
||||
void CChan::Clone(CChan& chan) {
|
||||
// We assume that m_sName and m_pUser are equal
|
||||
SetBufferCount(chan.GetBufferCount());
|
||||
SetBufferCount(chan.GetBufferCount(), true);
|
||||
SetKeepBuffer(chan.KeepBuffer());
|
||||
SetKey(chan.GetKey());
|
||||
SetDefaultModes(chan.GetDefaultModes());
|
||||
@@ -91,6 +91,13 @@ void CChan::Clone(CChan& chan) {
|
||||
}
|
||||
}
|
||||
|
||||
bool CChan::SetBufferCount(unsigned int u, bool bForce) {
|
||||
if (!bForce && u > CZNC::Get().GetMaxBufferSize())
|
||||
return false;
|
||||
m_uBufferCount = u;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CChan::Cycle() const {
|
||||
m_pUser->PutIRC("PART " + GetName() + "\r\nJOIN " + GetName() + " " + GetKey());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user