mirror of
https://github.com/znc/znc.git
synced 2026-07-07 02:11:20 +02:00
Resolve #967: separate chan & query buffer size settings
This commit is contained in:
@@ -85,7 +85,8 @@ class CAdminMod : public CModule {
|
||||
{"DenySetBindHost", boolean},
|
||||
{"DefaultChanModes", str},
|
||||
{"QuitMsg", str},
|
||||
{"BufferCount", integer},
|
||||
{"ChanBufferSize", integer},
|
||||
{"QueryBufferSize", integer},
|
||||
{"AutoClearChanBuffer", boolean},
|
||||
{"AutoClearQueryBuffer",boolean},
|
||||
{"Password", str},
|
||||
@@ -212,6 +213,10 @@ class CAdminMod : public CModule {
|
||||
PutModule("QuitMsg = " + pUser->GetQuitMsg());
|
||||
else if (sVar == "buffercount")
|
||||
PutModule("BufferCount = " + CString(pUser->GetBufferCount()));
|
||||
else if (sVar == "chanbuffersize")
|
||||
PutModule("ChanBufferSize = " + CString(pUser->GetChanBufferSize()));
|
||||
else if (sVar == "querybuffersize")
|
||||
PutModule("QueryBufferSize = " + CString(pUser->GetQueryBufferSize()));
|
||||
else if (sVar == "keepbuffer")
|
||||
PutModule("KeepBuffer = " + CString(!pUser->AutoClearChanBuffer())); // XXX compatibility crap, added in 0.207
|
||||
else if (sVar == "autoclearchanbuffer")
|
||||
@@ -340,11 +345,21 @@ class CAdminMod : public CModule {
|
||||
pUser->SetQuitMsg(sValue);
|
||||
PutModule("QuitMsg = " + sValue);
|
||||
}
|
||||
else if (sVar == "buffercount") {
|
||||
else if (sVar == "chanbuffersize" || sVar == "buffercount") {
|
||||
unsigned int i = sValue.ToUInt();
|
||||
// Admins don't have to honour the buffer limit
|
||||
if (pUser->SetBufferCount(i, GetUser()->IsAdmin())) {
|
||||
PutModule("BufferCount = " + sValue);
|
||||
if (pUser->SetChanBufferSize(i, GetUser()->IsAdmin())) {
|
||||
PutModule("ChanBufferSize = " + sValue);
|
||||
} else {
|
||||
PutModule("Setting failed, limit is " +
|
||||
CString(CZNC::Get().GetMaxBufferSize()));
|
||||
}
|
||||
}
|
||||
else if (sVar == "querybuffersize") {
|
||||
unsigned int i = sValue.ToUInt();
|
||||
// Admins don't have to honour the buffer limit
|
||||
if (pUser->SetQueryBufferSize(i, GetUser()->IsAdmin())) {
|
||||
PutModule("QueryBufferSize = " + sValue);
|
||||
} else {
|
||||
PutModule("Setting failed, limit is " +
|
||||
CString(CZNC::Get().GetMaxBufferSize()));
|
||||
|
||||
@@ -228,19 +228,38 @@
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3>Default Settings</h3>
|
||||
<h3>Channels</h3>
|
||||
<div class="sectionbg">
|
||||
<div class="sectionbody">
|
||||
<div class="subsection third">
|
||||
<div class="inputlabel">Channel Modes:</div>
|
||||
<div class="inputlabel">Default Modes:</div>
|
||||
<input type="text" name="chanmodes" value="<? VAR DefaultChanModes ?>" maxlength="32"
|
||||
title="These are the default modes ZNC will set when you join an empty channel." />
|
||||
<br /><span class="info">Empty = use standard value</span>
|
||||
</div>
|
||||
<div class="subsection third">
|
||||
<div class="inputlabel">Buffer Size:</div>
|
||||
<input type="number" name="bufsize" value="<? VAR BufferCount ?>" min="0"
|
||||
title="This is the amount of lines that the playback buffer will store before dropping off the oldest line. The buffers are stored in the memory by default." />
|
||||
<input type="number" name="chanbufsize" value="<? VAR ChanBufferSize ?>" min="0"
|
||||
title="This is the amount of lines that the playback buffer will store for channels before dropping off the oldest line. The buffers are stored in the memory by default." />
|
||||
<br /><span class="info">Empty = use standard value</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3>Queries</h3>
|
||||
<div class="sectionbg">
|
||||
<div class="sectionbody">
|
||||
<div class="subsection third">
|
||||
<div class="inputlabel">Max Buffers:</div>
|
||||
<input type="number" name="maxquerybuffers" value="<? VAR MaxQueryBuffers ?>" class="third" min="0"
|
||||
title="Maximum number of query buffers. 0 is unlimited."/>
|
||||
</div>
|
||||
<div class="subsection third">
|
||||
<div class="inputlabel">Buffer Size:</div>
|
||||
<input type="number" name="querybufsize" value="<? VAR QueryBufferSize ?>" min="0"
|
||||
title="This is the amount of lines that the playback buffer will store for queries before dropping off the oldest line. The buffers are stored in the memory by default." />
|
||||
<br /><span class="info">Empty = use standard value</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -304,11 +323,6 @@
|
||||
<input type="number" name="maxnetworks" value="<? VAR MaxNetworks ?>" class="third" min="0"
|
||||
title="Maximum number of IRC networks allowed for this user." <? IF !ImAdmin ?>disabled="disabled"<? ENDIF ?> />
|
||||
</div>
|
||||
<div class="subsection">
|
||||
<div class="inputlabel">Max Query Buffers:</div>
|
||||
<input type="number" name="maxquerybuffers" value="<? VAR MaxQueryBuffers ?>" class="third" min="0"
|
||||
title="Maximum number of query buffers. 0 is unlimited."/>
|
||||
</div>
|
||||
|
||||
<div class="subsection half" id="ctcpreplies_plain">
|
||||
<div class="inputlabel">CTCP Replies:</div>
|
||||
|
||||
+13
-4
@@ -261,12 +261,20 @@ public:
|
||||
pNewUser->SetDCCBindHost(pUser->GetDCCBindHost());
|
||||
}
|
||||
|
||||
sArg = WebSock.GetParam("bufsize"); if (!sArg.empty()) pNewUser->SetBufferCount(sArg.ToUInt(), spSession->IsAdmin());
|
||||
sArg = WebSock.GetParam("chanbufsize");
|
||||
if (!sArg.empty()) {
|
||||
// First apply the old limit in case the new one is too high
|
||||
if (pUser)
|
||||
pNewUser->SetBufferCount(pUser->GetBufferCount(), true);
|
||||
pNewUser->SetBufferCount(sArg.ToUInt(), spSession->IsAdmin());
|
||||
pNewUser->SetChanBufferSize(pUser->GetChanBufferSize(), true);
|
||||
pNewUser->SetChanBufferSize(sArg.ToUInt(), spSession->IsAdmin());
|
||||
}
|
||||
|
||||
sArg = WebSock.GetParam("querybufsize");
|
||||
if (!sArg.empty()) {
|
||||
// First apply the old limit in case the new one is too high
|
||||
if (pUser)
|
||||
pNewUser->SetQueryBufferSize(pUser->GetQueryBufferSize(), true);
|
||||
pNewUser->SetQueryBufferSize(sArg.ToUInt(), spSession->IsAdmin());
|
||||
}
|
||||
|
||||
pNewUser->SetSkinName(WebSock.GetParam("skin"));
|
||||
@@ -1211,7 +1219,8 @@ public:
|
||||
Tmpl["RealName"] = pUser->GetRealName();
|
||||
Tmpl["QuitMsg"] = pUser->GetQuitMsg();
|
||||
Tmpl["DefaultChanModes"] = pUser->GetDefaultChanModes();
|
||||
Tmpl["BufferCount"] = CString(pUser->GetBufferCount());
|
||||
Tmpl["ChanBufferSize"] = CString(pUser->GetChanBufferSize());
|
||||
Tmpl["QueryBufferSize"] = CString(pUser->GetQueryBufferSize());
|
||||
Tmpl["TimestampFormat"] = pUser->GetTimestampFormat();
|
||||
Tmpl["Timezone"] = pUser->GetTimezone();
|
||||
Tmpl["JoinTries"] = CString(pUser->JoinTries());
|
||||
|
||||
Reference in New Issue
Block a user