mirror of
https://github.com/znc/znc.git
synced 2026-08-06 08:52:57 +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:
@@ -354,7 +354,7 @@ bool CUser::Clone(const CUser& User, CString& sErrorRet, bool bCloneChans) {
|
||||
SetQuitMsg(User.GetQuitMsg());
|
||||
SetSkinName(User.GetSkinName());
|
||||
SetDefaultChanModes(User.GetDefaultChanModes());
|
||||
SetBufferCount(User.GetBufferCount());
|
||||
SetBufferCount(User.GetBufferCount(), true);
|
||||
SetJoinTries(User.JoinTries());
|
||||
SetMaxJoins(User.MaxJoins());
|
||||
|
||||
@@ -1168,11 +1168,16 @@ void CUser::SetDenySetVHost(bool b) { m_bDenySetVHost = b; }
|
||||
void CUser::SetDefaultChanModes(const CString& s) { m_sDefaultChanModes = s; }
|
||||
void CUser::SetIRCServer(const CString& s) { m_sIRCServer = s; }
|
||||
void CUser::SetQuitMsg(const CString& s) { m_sQuitMsg = s; }
|
||||
void CUser::SetBufferCount(unsigned int u) { m_uBufferCount = u; }
|
||||
void CUser::SetKeepBuffer(bool b) { m_bKeepBuffer = b; }
|
||||
|
||||
void CUser::CheckIRCConnect()
|
||||
{
|
||||
bool CUser::SetBufferCount(unsigned int u, bool bForce) {
|
||||
if (!bForce && u > CZNC::Get().GetMaxBufferSize())
|
||||
return false;
|
||||
m_uBufferCount = u;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CUser::CheckIRCConnect() {
|
||||
// Do we want to connect?
|
||||
if (m_bIRCConnectEnabled && GetIRCSock() == NULL)
|
||||
CZNC::Get().EnableConnectUser();
|
||||
|
||||
Reference in New Issue
Block a user