mirror of
https://github.com/znc/znc.git
synced 2026-08-09 18:32:55 +02:00
Fix some channel key-related mess ups.
ZNC used to keep track of two channel keys: The current one from the config and the last one it got from a +k channel mode (/mode #chan is done on join). The +k one, if it was known, always overwrote the config one and thus the one from the config doesnt need to be saved anymore. This patch now makes ZNC only use one var to hold the current channel key and this key is NOT overwritten for +k on channels. The reason for the last change: Stupid quakenet. (RFC, anyone?) In /mode replies quakenet always shows '*' as channel key, if one is set. This whole patch started with someone reporting that ZNC kept forgetting the current channel key and used '*' instead... git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1186 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -207,7 +207,6 @@ CString CChan::GetModeForNames() const {
|
||||
void CChan::SetModes(const CString& sModes) {
|
||||
m_musModes.clear();
|
||||
m_uLimit = 0;
|
||||
m_sCurKey = "";
|
||||
ModeChange(sModes);
|
||||
}
|
||||
|
||||
@@ -331,10 +330,6 @@ void CChan::ModeChange(const CString& sModes, const CString& sOpNick) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (uMode == M_Key) {
|
||||
m_sCurKey = (bAdd) ? sArg : "";
|
||||
}
|
||||
|
||||
if (!bList) {
|
||||
(bAdd) ? AddMode(uMode, sArg) : RemMode(uMode, sArg);
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
bool IsOn() const { return m_bIsOn; }
|
||||
const CString& GetName() const { return m_sName; }
|
||||
const map<unsigned char, CString>& GetModes() const { return m_musModes; }
|
||||
const CString& GetKey() const { return (!m_sCurKey.empty()) ? m_sCurKey : m_sKey; }
|
||||
const CString& GetKey() const { return m_sKey; }
|
||||
unsigned int GetLimit() const { return m_uLimit; }
|
||||
const CString& GetTopic() const { return m_sTopic; }
|
||||
const CString& GetTopicOwner() const { return m_sTopicOwner; }
|
||||
@@ -161,7 +161,6 @@ protected:
|
||||
bool m_bDisabled;
|
||||
CString m_sName;
|
||||
CString m_sKey;
|
||||
CString m_sCurKey;
|
||||
CString m_sTopic;
|
||||
CString m_sTopicOwner;
|
||||
unsigned long m_ulTopicDate;
|
||||
|
||||
Reference in New Issue
Block a user