From 92bb3992535c9c3edcf4a475a9eb0c971baef230 Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 2 Oct 2008 15:21:06 +0000 Subject: [PATCH] Fix cached perms when a chan is left If you were kicked from a channel and rejoined, you lost all your permissions (op, voice...), but ZNC still cached the old one you had internally. This wasn't noticed before, because this caches is not used much. This was found via autoop which thought it had op in a channel and so tried to give op to others. Call chain is like this: Receive KICK message -> pChan->SetIsOn(false) -> pChan->Reset() CChan::Reset() now properly clears the cache. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1236 726aef4b-f618-498e-8847-2d620e286838 --- Chan.cpp | 1 + Nick.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Chan.cpp b/Chan.cpp index 246c43c6..39232dbf 100644 --- a/Chan.cpp +++ b/Chan.cpp @@ -45,6 +45,7 @@ void CChan::Reset() { m_sTopicOwner = ""; m_ulTopicDate = 0; m_ulCreationDate = 0; + m_Nick.Reset(); ClearNicks(); ResetJoinTries(); } diff --git a/Nick.cpp b/Nick.cpp index 0ea96a27..b4ccdde4 100644 --- a/Nick.cpp +++ b/Nick.cpp @@ -24,6 +24,7 @@ CNick::~CNick() {} void CNick::Reset() { m_cPerm = '\0'; + m_suChanPerms.clear(); } CString CNick::Concat(const CString& sNick, const CString& sSuffix, unsigned int uMaxNickLen) {