mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix a wrong cached /mode reply
ZNC replies to /mode #chan with the cached channel modes without querying the IRCd. This was added to avoid traffic spikes to the ircd when a client logged in. The logic in this code had a bug that made it also reply with stale cached values if we once were but aren't anymore in that channel (e.g. after you've been kicked). Thanks to tomaw for reporting this. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1507 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -284,7 +284,10 @@ void CClient::ReadLine(const CString& sData) {
|
||||
if (m_pUser->IsChan(sTarget)) {
|
||||
CChan *pChan = m_pUser->FindChan(sTarget);
|
||||
|
||||
if (pChan && sModes.empty() && !pChan->GetModeString().empty()) {
|
||||
// If we are on that channel and already received a
|
||||
// /mode reply from the server, we can answer this
|
||||
// request ourself.
|
||||
if (pChan && pChan->IsOn() && sModes.empty() && !pChan->GetModeString().empty()) {
|
||||
PutClient(":" + m_pUser->GetIRCServer() + " 324 " + GetNick() + " " + sTarget + " " + pChan->GetModeString());
|
||||
if (pChan->GetCreationDate() > 0) {
|
||||
PutClient(":" + m_pUser->GetIRCServer() + " 329 " + GetNick() + " " + sTarget + " " + CString(pChan->GetCreationDate()));
|
||||
|
||||
Reference in New Issue
Block a user