mirror of
https://github.com/znc/znc.git
synced 2026-05-18 07:15:54 +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:
+14
-4
@@ -279,8 +279,13 @@ class CAdminMod : public CModule {
|
||||
}
|
||||
else if (sVar == "buffercount") {
|
||||
unsigned int i = sValue.ToUInt();
|
||||
pUser->SetBufferCount(i);
|
||||
PutModule("BufferCount = " + sValue);
|
||||
// Admins don't have to honour the buffer limit
|
||||
if (pUser->SetBufferCount(i), m_pUser->IsAdmin()) {
|
||||
PutModule("BufferCount = " + sValue);
|
||||
} else {
|
||||
PutModule("Setting failed, limit is " +
|
||||
CString(CZNC::Get().GetMaxBufferSize()));
|
||||
}
|
||||
}
|
||||
else if (sVar == "keepbuffer") {
|
||||
bool b = sValue.ToBool();
|
||||
@@ -408,8 +413,13 @@ class CAdminMod : public CModule {
|
||||
PutModule("DefModes = " + sValue);
|
||||
} else if (sVar == "buffer") {
|
||||
unsigned int i = sValue.ToUInt();
|
||||
pChan->SetBufferCount(i);
|
||||
PutModule("Buffer = " + CString(i));
|
||||
// Admins don't have to honour the buffer limit
|
||||
if (pChan->SetBufferCount(i), m_pUser->IsAdmin()) {
|
||||
PutModule("Buffer = " + sValue);
|
||||
} else {
|
||||
PutModule("Setting failed, limit is " +
|
||||
CString(CZNC::Get().GetMaxBufferSize()));
|
||||
}
|
||||
} else if (sVar == "inconfig") {
|
||||
bool b = sValue.ToBool();
|
||||
pChan->SetInConfig(b);
|
||||
|
||||
Reference in New Issue
Block a user