mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
Rename (non-) KeepBuffer to AutoClearChanBuffer.
It should be a less confusing name...
This commit is contained in:
+3
-3
@@ -111,7 +111,7 @@ public:
|
||||
void SetTopicOwner(const CString& s) { m_sTopicOwner = s; }
|
||||
void SetTopicDate(unsigned long u) { m_ulTopicDate = u; }
|
||||
void SetDefaultModes(const CString& s) { m_sDefaultModes = s; }
|
||||
void SetKeepBuffer(bool b);
|
||||
void SetAutoClearChanBuffer(bool b);
|
||||
void SetDetached(bool b = true) { m_bDetached = b; }
|
||||
void SetInConfig(bool b) { m_bInConfig = b; }
|
||||
void SetCreationDate(unsigned long u) { m_ulCreationDate = u; }
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
const CString& GetDefaultModes() const { return m_sDefaultModes; }
|
||||
const map<CString,CNick>& GetNicks() const { return m_msNicks; }
|
||||
unsigned int GetNickCount() const { return m_msNicks.size(); }
|
||||
bool KeepBuffer() const { return m_bKeepBuffer; }
|
||||
bool AutoClearChanBuffer() const { return m_bAutoClearChanBuffer; }
|
||||
bool IsDetached() const { return m_bDetached; }
|
||||
bool InConfig() const { return m_bInConfig; }
|
||||
unsigned long GetCreationDate() const { return m_ulCreationDate; }
|
||||
@@ -148,7 +148,7 @@ private:
|
||||
protected:
|
||||
bool m_bDetached;
|
||||
bool m_bIsOn;
|
||||
bool m_bKeepBuffer;
|
||||
bool m_bAutoClearChanBuffer;
|
||||
bool m_bInConfig;
|
||||
bool m_bDisabled;
|
||||
CString m_sName;
|
||||
|
||||
+6
-3
@@ -116,7 +116,7 @@ public:
|
||||
bool AddCTCPReply(const CString& sCTCP, const CString& sReply);
|
||||
bool DelCTCPReply(const CString& sCTCP);
|
||||
bool SetBufferCount(unsigned int u, bool bForce = false);
|
||||
void SetKeepBuffer(bool b);
|
||||
void SetAutoClearChanBuffer(bool b);
|
||||
|
||||
void SetBeingDeleted(bool b) { m_bBeingDeleted = b; }
|
||||
void SetTimestampFormat(const CString& s) { m_sTimestampFormat = s; }
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
CString GetQuitMsg() const;
|
||||
const MCString& GetCTCPReplies() const;
|
||||
unsigned int GetBufferCount() const;
|
||||
bool KeepBuffer() const;
|
||||
bool AutoClearChanBuffer() const;
|
||||
bool IsBeingDeleted() const { return m_bBeingDeleted; }
|
||||
CString GetTimezone() const { return m_sTimezone; }
|
||||
unsigned long long BytesRead() const { return m_uBytesRead; }
|
||||
@@ -195,7 +195,7 @@ protected:
|
||||
bool m_bDenyLoadMod;
|
||||
bool m_bAdmin;
|
||||
bool m_bDenySetBindHost;
|
||||
bool m_bKeepBuffer;
|
||||
bool m_bAutoClearChanBuffer;
|
||||
bool m_bBeingDeleted;
|
||||
bool m_bAppendTimestamp;
|
||||
bool m_bPrependTimestamp;
|
||||
@@ -212,6 +212,9 @@ protected:
|
||||
CString m_sSkinName;
|
||||
|
||||
CModules* m_pModules;
|
||||
|
||||
private:
|
||||
void SetKeepBuffer(bool b) { SetAutoClearChanBuffer(!b); } // XXX compatibility crap, added in 0.207
|
||||
};
|
||||
|
||||
#endif // !_USER_H
|
||||
|
||||
+48
-35
@@ -44,27 +44,27 @@ class CAdminMod : public CModule {
|
||||
static const char* integer = "Integer";
|
||||
//static const char* doublenum = "Double";
|
||||
static const char* vars[][2] = {
|
||||
{"Nick", str},
|
||||
{"Altnick", str},
|
||||
{"Ident", str},
|
||||
{"RealName", str},
|
||||
{"BindHost", str},
|
||||
{"MultiClients", boolean},
|
||||
{"DenyLoadMod", boolean},
|
||||
{"DenySetBindHost", boolean},
|
||||
{"DefaultChanModes", str},
|
||||
{"QuitMsg", str},
|
||||
{"BufferCount", integer},
|
||||
{"KeepBuffer", boolean},
|
||||
{"Password", str},
|
||||
{"JoinTries", integer},
|
||||
{"Timezone", str},
|
||||
{"Admin", boolean},
|
||||
{"AppendTimestamp", boolean},
|
||||
{"PrependTimestamp", boolean},
|
||||
{"TimestampFormat", str},
|
||||
{"DCCBindHost", str},
|
||||
{"StatusPrefix", str}
|
||||
{"Nick", str},
|
||||
{"Altnick", str},
|
||||
{"Ident", str},
|
||||
{"RealName", str},
|
||||
{"BindHost", str},
|
||||
{"MultiClients", boolean},
|
||||
{"DenyLoadMod", boolean},
|
||||
{"DenySetBindHost", boolean},
|
||||
{"DefaultChanModes", str},
|
||||
{"QuitMsg", str},
|
||||
{"BufferCount", integer},
|
||||
{"AutoClearChanBuffer", boolean},
|
||||
{"Password", str},
|
||||
{"JoinTries", integer},
|
||||
{"Timezone", str},
|
||||
{"Admin", boolean},
|
||||
{"AppendTimestamp", boolean},
|
||||
{"PrependTimestamp", boolean},
|
||||
{"TimestampFormat", str},
|
||||
{"DCCBindHost", str},
|
||||
{"StatusPrefix", str}
|
||||
};
|
||||
for (unsigned int i = 0; i != ARRAY_SIZE(vars); ++i) {
|
||||
VarTable.AddRow();
|
||||
@@ -78,12 +78,12 @@ class CAdminMod : public CModule {
|
||||
CVarTable.AddColumn("Variable");
|
||||
CVarTable.AddColumn("Type");
|
||||
static const char* cvars[][2] = {
|
||||
{"DefModes", str},
|
||||
{"Key", str},
|
||||
{"Buffer", integer},
|
||||
{"InConfig", boolean},
|
||||
{"KeepBuffer", boolean},
|
||||
{"Detached", boolean}
|
||||
{"DefModes", str},
|
||||
{"Key", str},
|
||||
{"Buffer", integer},
|
||||
{"InConfig", boolean},
|
||||
{"AutoClearChanBuffer", boolean},
|
||||
{"Detached", boolean}
|
||||
};
|
||||
for (unsigned int i = 0; i != ARRAY_SIZE(cvars); ++i) {
|
||||
CVarTable.AddRow();
|
||||
@@ -152,7 +152,9 @@ class CAdminMod : public CModule {
|
||||
else if (sVar == "buffercount")
|
||||
PutModule("BufferCount = " + CString(pUser->GetBufferCount()));
|
||||
else if (sVar == "keepbuffer")
|
||||
PutModule("KeepBuffer = " + CString(pUser->KeepBuffer()));
|
||||
PutModule("KeepBuffer = " + CString(!pUser->AutoClearChanBuffer())); // XXX compatibility crap, added in 0.207
|
||||
else if (sVar == "autoclearchanbuffer")
|
||||
PutModule("AutoClearChanBuffer = " + CString(pUser->AutoClearChanBuffer()));
|
||||
else if (sVar == "jointries")
|
||||
PutModule("JoinTries = " + CString(pUser->JoinTries()));
|
||||
else if (sVar == "timezone")
|
||||
@@ -252,10 +254,15 @@ class CAdminMod : public CModule {
|
||||
CString(CZNC::Get().GetMaxBufferSize()));
|
||||
}
|
||||
}
|
||||
else if (sVar == "keepbuffer") {
|
||||
else if (sVar == "keepbuffer") { // XXX compatibility crap, added in 0.207
|
||||
bool b = !sValue.ToBool();
|
||||
pUser->SetAutoClearChanBuffer(b);
|
||||
PutModule("AutoClearChanBuffer = " + CString(b));
|
||||
}
|
||||
else if (sVar == "autoclearchanbuffer") {
|
||||
bool b = sValue.ToBool();
|
||||
pUser->SetKeepBuffer(b);
|
||||
PutModule("KeepBuffer = " + CString(b));
|
||||
pUser->SetAutoClearChanBuffer(b);
|
||||
PutModule("AutoClearChanBuffer = " + CString(b));
|
||||
}
|
||||
else if (sVar == "password") {
|
||||
const CString sSalt = CUtils::GetSalt();
|
||||
@@ -349,7 +356,9 @@ class CAdminMod : public CModule {
|
||||
else if (sVar == "inconfig")
|
||||
PutModule("InConfig = " + CString(pChan->InConfig()));
|
||||
else if (sVar == "keepbuffer")
|
||||
PutModule("KeepBuffer = " + CString(pChan->KeepBuffer()));
|
||||
PutModule("KeepBuffer = " + CString(!pChan->AutoClearChanBuffer()));// XXX compatibility crap, added in 0.207
|
||||
else if (sVar == "autoclearchanbuffer")
|
||||
PutModule("AutoClearChanBuffer = " + CString(pChan->AutoClearChanBuffer()));
|
||||
else if (sVar == "detached")
|
||||
PutModule("Detached = " + CString(pChan->IsDetached()));
|
||||
else if (sVar == "key")
|
||||
@@ -402,10 +411,14 @@ class CAdminMod : public CModule {
|
||||
bool b = sValue.ToBool();
|
||||
pChan->SetInConfig(b);
|
||||
PutModule("InConfig = " + CString(b));
|
||||
} else if (sVar == "keepbuffer") {
|
||||
} else if (sVar == "keepbuffer") { // XXX compatibility crap, added in 0.207
|
||||
bool b = !sValue.ToBool();
|
||||
pChan->SetAutoClearChanBuffer(b);
|
||||
PutModule("AutoClearChanBuffer = " + CString(b));
|
||||
} else if (sVar == "autoclearchanbuffer") {
|
||||
bool b = sValue.ToBool();
|
||||
pChan->SetKeepBuffer(b);
|
||||
PutModule("KeepBuffer = " + CString(b));
|
||||
pChan->SetAutoClearChanBuffer(b);
|
||||
PutModule("AutoClearChanBuffer = " + CString(b));
|
||||
} else if (sVar == "detached") {
|
||||
bool b = sValue.ToBool();
|
||||
if (pChan->IsDetached() != b) {
|
||||
|
||||
@@ -18,8 +18,8 @@ public:
|
||||
virtual ~CBuffExtras() {}
|
||||
|
||||
void AddBuffer(CChan& Channel, const CString& sMessage) {
|
||||
// If they have keep buffer disabled, only add messages if no client is connected
|
||||
if (!Channel.KeepBuffer() && m_pNetwork->IsUserOnline())
|
||||
// If they have AutoClearChanBuffer enabled, only add messages if no client is connected
|
||||
if (Channel.AutoClearChanBuffer() && m_pNetwork->IsUserOnline())
|
||||
return;
|
||||
|
||||
Channel.AddBuffer(":" + GetModNick() + "!" + GetModName() + "@znc.in PRIVMSG " + _NAMEDFMT(Channel.GetName()) + " :{text}", sMessage);
|
||||
|
||||
@@ -25,9 +25,9 @@ public:
|
||||
continue;
|
||||
|
||||
(*it)->ClearBuffer();
|
||||
// We force KeepBuffer on all channels since this module
|
||||
// doesnt make any sense without
|
||||
(*it)->SetKeepBuffer(true);
|
||||
// We deny AutoClearChanBuffer on all channels since this module
|
||||
// doesn't make any sense with it
|
||||
(*it)->SetAutoClearChanBuffer(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public:
|
||||
if (it != EndNV()) {
|
||||
CChan* pChan = m_pNetwork->FindChan(sTarget);
|
||||
if (pChan) {
|
||||
if (pChan->KeepBuffer())
|
||||
if (!pChan->AutoClearChanBuffer())
|
||||
pChan->AddBuffer(":\244" + _NAMEDFMT(m_pNetwork->GetIRCNick().GetNickMask()) + " PRIVMSG " + _NAMEDFMT(sTarget) + " :" + _NAMEDFMT(sMessage));
|
||||
m_pUser->PutUser(":\244" + m_pNetwork->GetIRCNick().GetNickMask() + " PRIVMSG " + sTarget + " :" + sMessage, NULL, m_pClient);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<label for="save">Save to config</label>
|
||||
</span>
|
||||
<? LOOP OptionLoop ?>
|
||||
<span class="checkboxandlabel">
|
||||
<span class="checkboxandlabel" title="<? VAR Tooltip ?>">
|
||||
<input type="checkbox" name="<? VAR Name ?>" id="opt_<? VAR Name ?>" value="true"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> />
|
||||
<label for="opt_<? VAR Name ?>"><? VAR DisplayName ?></label>
|
||||
</span>
|
||||
@@ -74,4 +74,4 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<? INC Footer.tmpl ?>
|
||||
<? INC Footer.tmpl ?>
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
<div class="sectionbg">
|
||||
<div class="sectionbody lotsofcheckboxes">
|
||||
<? LOOP OptionLoop ?>
|
||||
<span class="checkboxandlabel">
|
||||
<span class="checkboxandlabel" title="<? VAR Tooltip ?>">
|
||||
<input type="checkbox" name="<? VAR Name ?>" id="opt_<? VAR Name ?>" value="1"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> />
|
||||
<label for="opt_<? VAR Name ?>"><? VAR DisplayName ?></label>
|
||||
</span>
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
const vector<CChan *>& vChans = m_pNetwork->GetChans();
|
||||
for (u_int a = 0; a < vChans.size(); a++)
|
||||
{
|
||||
if (!vChans[a]->KeepBuffer())
|
||||
if (vChans[a]->AutoClearChanBuffer())
|
||||
continue;
|
||||
|
||||
if (!BootStrap(vChans[a]))
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
CString sPath = GetPath(vChans[a]->GetName());
|
||||
CFile File(sPath);
|
||||
|
||||
if (!vChans[a]->KeepBuffer()) {
|
||||
if (vChans[a]->AutoClearChanBuffer()) {
|
||||
File.Delete();
|
||||
continue;
|
||||
}
|
||||
@@ -268,8 +268,8 @@ public:
|
||||
|
||||
void AddBuffer(CChan& chan, const CString &sLine)
|
||||
{
|
||||
// If they have keep buffer disabled, only add messages if no client is connected
|
||||
if (!chan.KeepBuffer() && m_pNetwork->IsUserAttached())
|
||||
// If they have AutoClearChanBuffer enabled, only add messages if no client is connected
|
||||
if (chan.AutoClearChanBuffer() && m_pNetwork->IsUserAttached())
|
||||
return;
|
||||
chan.AddBuffer(sLine);
|
||||
}
|
||||
|
||||
+10
-8
@@ -226,7 +226,7 @@ public:
|
||||
pNewUser->SetBufferCount(pUser->GetBufferCount(), true);
|
||||
pNewUser->SetBufferCount(WebSock.GetParam("bufsize").ToUInt(), spSession->IsAdmin());
|
||||
pNewUser->SetSkinName(WebSock.GetParam("skin"));
|
||||
pNewUser->SetKeepBuffer(WebSock.GetParam("keepbuffer").ToBool());
|
||||
pNewUser->SetAutoClearChanBuffer(WebSock.GetParam("autoclearchanbuffer").ToBool());
|
||||
pNewUser->SetMultiClients(WebSock.GetParam("multiclients").ToBool());
|
||||
pNewUser->SetTimestampAppend(WebSock.GetParam("appendtimestamp").ToBool());
|
||||
pNewUser->SetTimestampPrepend(WebSock.GetParam("prependtimestamp").ToBool());
|
||||
@@ -569,9 +569,10 @@ public:
|
||||
// o1 used to be AutoCycle which was removed
|
||||
|
||||
CTemplate& o2 = Tmpl.AddRow("OptionLoop");
|
||||
o2["Name"] = "keepbuffer";
|
||||
o2["DisplayName"] = "Keep Buffer";
|
||||
if ((pChan && pChan->KeepBuffer()) || (!pChan && pUser->KeepBuffer())) { o2["Checked"] = "true"; }
|
||||
o2["Name"] = "autoclearchanbuffer";
|
||||
o2["DisplayName"] = "Auto Clear Chan Buffer";
|
||||
o2["Tooltip"] = "Automatically Clear Channel Buffer After Playback";
|
||||
if ((pChan && pChan->AutoClearChanBuffer()) || (!pChan && pUser->AutoClearChanBuffer())) { o2["Checked"] = "true"; }
|
||||
|
||||
CTemplate& o3 = Tmpl.AddRow("OptionLoop");
|
||||
o3["Name"] = "detached";
|
||||
@@ -616,7 +617,7 @@ public:
|
||||
pChan->SetBufferCount(WebSock.GetParam("buffercount").ToUInt(), spSession->IsAdmin());
|
||||
pChan->SetDefaultModes(WebSock.GetParam("defmodes"));
|
||||
pChan->SetInConfig(WebSock.GetParam("save").ToBool());
|
||||
pChan->SetKeepBuffer(WebSock.GetParam("keepbuffer").ToBool());
|
||||
pChan->SetAutoClearChanBuffer(WebSock.GetParam("autoclearchanbuffer").ToBool());
|
||||
pChan->SetKey(WebSock.GetParam("key"));
|
||||
|
||||
bool bDetached = WebSock.GetParam("detached").ToBool();
|
||||
@@ -1054,9 +1055,10 @@ public:
|
||||
}
|
||||
|
||||
CTemplate& o1 = Tmpl.AddRow("OptionLoop");
|
||||
o1["Name"] = "keepbuffer";
|
||||
o1["DisplayName"] = "Keep Buffer";
|
||||
if (!pUser || pUser->KeepBuffer()) { o1["Checked"] = "true"; }
|
||||
o1["Name"] = "autoclearchanbuffer";
|
||||
o1["DisplayName"] = "Auto Clear Chan Buffer";
|
||||
o1["Tooltip"] = "Automatically Clear Channel Buffer After Playback (the default value for new channels)";
|
||||
if (!pUser || pUser->AutoClearChanBuffer()) { o1["Checked"] = "true"; }
|
||||
|
||||
/* o2 used to be auto cycle which was removed */
|
||||
|
||||
|
||||
+13
-11
@@ -28,15 +28,17 @@ CChan::CChan(const CString& sName, CIRCNetwork* pNetwork, bool bInConfig, CConfi
|
||||
m_bDetached = false;
|
||||
m_bDisabled = false;
|
||||
SetBufferCount(m_pNetwork->GetUser()->GetBufferCount(), true);
|
||||
SetKeepBuffer(m_pNetwork->GetUser()->KeepBuffer());
|
||||
SetAutoClearChanBuffer(m_pNetwork->GetUser()->AutoClearChanBuffer());
|
||||
Reset();
|
||||
|
||||
if (pConfig) {
|
||||
CString sValue;
|
||||
if (pConfig->FindStringEntry("buffer", sValue))
|
||||
SetBufferCount(sValue.ToUInt(), true);
|
||||
if (pConfig->FindStringEntry("autoclearchanbuffer", sValue))
|
||||
SetAutoClearChanBuffer(sValue.ToBool());
|
||||
if (pConfig->FindStringEntry("keepbuffer", sValue))
|
||||
SetKeepBuffer(sValue.ToBool());
|
||||
SetAutoClearChanBuffer(!sValue.ToBool()); // XXX Compatibility crap, added in 0.207
|
||||
if (pConfig->FindStringEntry("detached", sValue))
|
||||
SetDetached(sValue.ToBool());
|
||||
if (pConfig->FindStringEntry("autocycle", sValue))
|
||||
@@ -72,8 +74,8 @@ CConfig CChan::ToConfig() {
|
||||
|
||||
if (pUser->GetBufferCount() != GetBufferCount())
|
||||
config.AddKeyValuePair("Buffer", CString(GetBufferCount()));
|
||||
if (pUser->KeepBuffer() != KeepBuffer())
|
||||
config.AddKeyValuePair("KeepBuffer", CString(KeepBuffer()));
|
||||
if (pUser->AutoClearChanBuffer() != AutoClearChanBuffer())
|
||||
config.AddKeyValuePair("AutoClearChanBuffer", CString(AutoClearChanBuffer()));
|
||||
if (IsDetached())
|
||||
config.AddKeyValuePair("Detached", "true");
|
||||
if (!GetKey().empty())
|
||||
@@ -87,7 +89,7 @@ CConfig CChan::ToConfig() {
|
||||
void CChan::Clone(CChan& chan) {
|
||||
// We assume that m_sName and m_pNetwork are equal
|
||||
SetBufferCount(chan.GetBufferCount(), true);
|
||||
SetKeepBuffer(chan.KeepBuffer());
|
||||
SetAutoClearChanBuffer(chan.AutoClearChanBuffer());
|
||||
SetKey(chan.GetKey());
|
||||
SetDefaultModes(chan.GetDefaultModes());
|
||||
|
||||
@@ -219,10 +221,10 @@ void CChan::SetModes(const CString& sModes) {
|
||||
ModeChange(sModes);
|
||||
}
|
||||
|
||||
void CChan::SetKeepBuffer(bool b) {
|
||||
m_bKeepBuffer = b;
|
||||
void CChan::SetAutoClearChanBuffer(bool b) {
|
||||
m_bAutoClearChanBuffer = b;
|
||||
|
||||
if (!m_bKeepBuffer && !IsDetached() && m_pNetwork->IsUserOnline()) {
|
||||
if (m_bAutoClearChanBuffer && !IsDetached() && m_pNetwork->IsUserOnline()) {
|
||||
ClearBuffer();
|
||||
}
|
||||
}
|
||||
@@ -349,8 +351,8 @@ CString CChan::GetOptions() const {
|
||||
sRet += (sRet.empty()) ? "Detached" : ", Detached";
|
||||
}
|
||||
|
||||
if (KeepBuffer()) {
|
||||
sRet += (sRet.empty()) ? "KeepBuffer" : ", KeepBuffer";
|
||||
if (AutoClearChanBuffer()) {
|
||||
sRet += (sRet.empty()) ? "AutoClearChanBuffer" : ", AutoClearChanBuffer";
|
||||
}
|
||||
|
||||
return sRet;
|
||||
@@ -561,7 +563,7 @@ void CChan::SendBuffer(CClient* pClient) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!KeepBuffer()) {
|
||||
if (AutoClearChanBuffer()) {
|
||||
ClearBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -238,7 +238,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
if (m_pNetwork) {
|
||||
CChan* pChan = m_pNetwork->FindChan(sTarget);
|
||||
|
||||
if ((pChan) && (pChan->KeepBuffer())) {
|
||||
if ((pChan) && (!pChan->AutoClearChanBuffer())) {
|
||||
pChan->AddBuffer(":" + _NAMEDFMT(GetNickMask()) + " NOTICE " + _NAMEDFMT(sTarget) + " :{text}", sMsg);
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
NETWORKMODULECALL(OnUserAction(sTarget, sMessage), m_pUser, m_pNetwork, this, return);
|
||||
sCTCP = "ACTION " + sMessage;
|
||||
|
||||
if (pChan && (pChan->KeepBuffer() || !m_pNetwork->IsUserOnline())) {
|
||||
if (pChan && (!pChan->AutoClearChanBuffer() || !m_pNetwork->IsUserOnline())) {
|
||||
pChan->AddBuffer(":" + _NAMEDFMT(GetNickMask()) + " PRIVMSG " + _NAMEDFMT(sTarget) + " :\001ACTION {text}\001", sMessage);
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
if (m_pNetwork) {
|
||||
CChan* pChan = m_pNetwork->FindChan(sTarget);
|
||||
|
||||
if ((pChan) && (pChan->KeepBuffer() || !m_pNetwork->IsUserOnline())) {
|
||||
if ((pChan) && (!pChan->AutoClearChanBuffer() || !m_pNetwork->IsUserOnline())) {
|
||||
pChan->AddBuffer(":" + _NAMEDFMT(GetNickMask()) + " PRIVMSG " + _NAMEDFMT(sTarget) + " :{text}", sMsg);
|
||||
}
|
||||
|
||||
|
||||
@@ -392,7 +392,7 @@ void CClient::UserCommand(CString& sLine) {
|
||||
Table.SetCell("Name", pChan->GetPermStr() + pChan->GetName());
|
||||
Table.SetCell("Status", ((vChans[a]->IsOn()) ? ((vChans[a]->IsDetached()) ? "Detached" : "Joined") : ((vChans[a]->IsDisabled()) ? "Disabled" : "Trying")));
|
||||
Table.SetCell("Conf", CString((pChan->InConfig()) ? "yes" : ""));
|
||||
Table.SetCell("Buf", CString((pChan->KeepBuffer()) ? "*" : "") + CString(pChan->GetBufferCount()));
|
||||
Table.SetCell("Buf", CString((pChan->AutoClearChanBuffer()) ? "*" : "") + CString(pChan->GetBufferCount()));
|
||||
Table.SetCell("Modes", pChan->GetModeString());
|
||||
Table.SetCell("Users", CString(pChan->GetNickCount()));
|
||||
|
||||
|
||||
+3
-3
@@ -921,7 +921,7 @@ bool CIRCSock::OnChanCTCP(CNick& Nick, const CString& sChan, CString& sMessage)
|
||||
// Record a /me
|
||||
if (sMessage.TrimPrefix("ACTION ")) {
|
||||
IRCSOCKMODULECALL(OnChanAction(Nick, *pChan, sMessage), return true);
|
||||
if (pChan->KeepBuffer() || !m_pNetwork->IsUserOnline() || pChan->IsDetached()) {
|
||||
if (!pChan->AutoClearChanBuffer() || !m_pNetwork->IsUserOnline() || pChan->IsDetached()) {
|
||||
pChan->AddBuffer(":" + _NAMEDFMT(Nick.GetNickMask()) + " PRIVMSG " + _NAMEDFMT(sChan) + " :\001ACTION {text}\001", sMessage);
|
||||
}
|
||||
sMessage = "ACTION " + sMessage;
|
||||
@@ -939,7 +939,7 @@ bool CIRCSock::OnChanNotice(CNick& Nick, const CString& sChan, CString& sMessage
|
||||
if (pChan) {
|
||||
IRCSOCKMODULECALL(OnChanNotice(Nick, *pChan, sMessage), return true);
|
||||
|
||||
if (pChan->KeepBuffer() || !m_pNetwork->IsUserOnline() || pChan->IsDetached()) {
|
||||
if (!pChan->AutoClearChanBuffer() || !m_pNetwork->IsUserOnline() || pChan->IsDetached()) {
|
||||
pChan->AddBuffer(":" + _NAMEDFMT(Nick.GetNickMask()) + " NOTICE " + _NAMEDFMT(sChan) + " :{text}", sMessage);
|
||||
}
|
||||
}
|
||||
@@ -952,7 +952,7 @@ bool CIRCSock::OnChanMsg(CNick& Nick, const CString& sChan, CString& sMessage) {
|
||||
if (pChan) {
|
||||
IRCSOCKMODULECALL(OnChanMsg(Nick, *pChan, sMessage), return true);
|
||||
|
||||
if (pChan->KeepBuffer() || !m_pNetwork->IsUserOnline() || pChan->IsDetached()) {
|
||||
if (!pChan->AutoClearChanBuffer() || !m_pNetwork->IsUserOnline() || pChan->IsDetached()) {
|
||||
pChan->AddBuffer(":" + _NAMEDFMT(Nick.GetNickMask()) + " PRIVMSG " + _NAMEDFMT(sChan) + " :{text}", sMessage);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-6
@@ -78,7 +78,7 @@ CUser::CUser(const CString& sUserName)
|
||||
m_sStatusPrefix = "*";
|
||||
m_uBufferCount = 50;
|
||||
m_uMaxJoinTries = 10;
|
||||
m_bKeepBuffer = false;
|
||||
m_bAutoClearChanBuffer = true;
|
||||
m_bBeingDeleted = false;
|
||||
m_sTimestampFormat = "[%H:%M:%S]";
|
||||
m_bAppendTimestamp = false;
|
||||
@@ -137,7 +137,8 @@ bool CUser::ParseConfig(CConfig* pConfig, CString& sError) {
|
||||
};
|
||||
size_t numUIntOptions = sizeof(UIntOptions) / sizeof(UIntOptions[0]);
|
||||
TOption<bool> BoolOptions[] = {
|
||||
{ "keepbuffer", &CUser::SetKeepBuffer },
|
||||
{ "keepbuffer", &CUser::SetKeepBuffer }, // XXX compatibility crap from pre-0.207
|
||||
{ "autoclearchanbuffer", &CUser::SetAutoClearChanBuffer },
|
||||
{ "multiclients", &CUser::SetMultiClients },
|
||||
{ "denyloadmod", &CUser::SetDenyLoadMod },
|
||||
{ "admin", &CUser::SetAdmin },
|
||||
@@ -663,7 +664,7 @@ bool CUser::Clone(const CUser& User, CString& sErrorRet, bool bCloneNetworks) {
|
||||
// !CTCP Replies
|
||||
|
||||
// Flags
|
||||
SetKeepBuffer(User.KeepBuffer());
|
||||
SetAutoClearChanBuffer(User.AutoClearChanBuffer());
|
||||
SetMultiClients(User.MultiClients());
|
||||
SetDenyLoadMod(User.DenyLoadMod());
|
||||
SetAdmin(User.IsAdmin());
|
||||
@@ -813,7 +814,7 @@ CConfig CUser::ToConfig() {
|
||||
config.AddKeyValuePair("Skin", GetSkinName());
|
||||
config.AddKeyValuePair("ChanModes", GetDefaultChanModes());
|
||||
config.AddKeyValuePair("Buffer", CString(GetBufferCount()));
|
||||
config.AddKeyValuePair("KeepBuffer", CString(KeepBuffer()));
|
||||
config.AddKeyValuePair("AutoClearChanBuffer", CString(AutoClearChanBuffer()));
|
||||
config.AddKeyValuePair("MultiClients", CString(MultiClients()));
|
||||
config.AddKeyValuePair("DenyLoadMod", CString(DenyLoadMod()));
|
||||
config.AddKeyValuePair("Admin", CString(IsAdmin()));
|
||||
@@ -1032,7 +1033,7 @@ void CUser::SetAdmin(bool b) { m_bAdmin = b; }
|
||||
void CUser::SetDenySetBindHost(bool b) { m_bDenySetBindHost = b; }
|
||||
void CUser::SetDefaultChanModes(const CString& s) { m_sDefaultChanModes = s; }
|
||||
void CUser::SetQuitMsg(const CString& s) { m_sQuitMsg = s; }
|
||||
void CUser::SetKeepBuffer(bool b) { m_bKeepBuffer = b; }
|
||||
void CUser::SetAutoClearChanBuffer(bool b) { m_bAutoClearChanBuffer = b; }
|
||||
|
||||
bool CUser::SetBufferCount(unsigned int u, bool bForce) {
|
||||
if (!bForce && u > CZNC::Get().GetMaxBufferSize())
|
||||
@@ -1107,7 +1108,7 @@ const CString& CUser::GetDefaultChanModes() const { return m_sDefaultChanModes;
|
||||
CString CUser::GetQuitMsg() const { return (!m_sQuitMsg.Trim_n().empty()) ? m_sQuitMsg : CZNC::GetTag(false); }
|
||||
const MCString& CUser::GetCTCPReplies() const { return m_mssCTCPReplies; }
|
||||
unsigned int CUser::GetBufferCount() const { return m_uBufferCount; }
|
||||
bool CUser::KeepBuffer() const { return m_bKeepBuffer; }
|
||||
bool CUser::AutoClearChanBuffer() const { return m_bAutoClearChanBuffer; }
|
||||
//CString CUser::GetSkinName() const { return (!m_sSkinName.empty()) ? m_sSkinName : CZNC::Get().GetSkinName(); }
|
||||
CString CUser::GetSkinName() const { return m_sSkinName; }
|
||||
const CString& CUser::GetUserPath() const { if (!CFile::Exists(m_sUserPath)) { CDir::MakeDir(m_sUserPath); } return m_sUserPath; }
|
||||
|
||||
+3
-3
@@ -687,10 +687,10 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
|
||||
if (uBufferCount) {
|
||||
vsLines.push_back("\tBuffer = " + CString(uBufferCount));
|
||||
}
|
||||
if (CUtils::GetBoolInput("Would you like to keep buffers after replay?", false)) {
|
||||
vsLines.push_back("\tKeepBuffer = true");
|
||||
if (CUtils::GetBoolInput("Would you like to clear channel buffers after replay?", true)) {
|
||||
vsLines.push_back("\tAutoClearChanBuffer = true");
|
||||
} else {
|
||||
vsLines.push_back("\tKeepBuffer = false");
|
||||
vsLines.push_back("\tAutoClearChanBuffer = false");
|
||||
}
|
||||
|
||||
CUtils::GetInput("Default channel modes", sAnswer, "+stn");
|
||||
|
||||
Reference in New Issue
Block a user