From 564226c0ec6a14a2df29caf5735a4fe13bb12903 Mon Sep 17 00:00:00 2001 From: psychon Date: Sat, 24 Jul 2010 20:34:26 +0000 Subject: [PATCH] Attach to channels when joining them Here's the scenario: - Client joins #chan, then detaches from #chan (/detach #chan). - $EVIL_OP kicks us from #chan. Since it's detached, this is not forwarded. - Client reattaches to #chan (sends us a join for #chan). What happens is that the client does *not* receive a successful JOIN for the channel, but TOPIC, MODE and the NAMES reply is forwarded. On proper clients this would result in weird traffic shown in the server window. On broken clients like irssi which don't wait for the JOIN reply from the server, this meant that it looked like a successful JOIN to the client while ZNC still thought the channel was detached. This is fixed by automatically attaching to the channel when we join it due to a client. This means that the channel will always be attached after a JOIN. Thanks to tomaw for finding this and making me actually understand that this is a bug in ZNC, not irssi. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2092 726aef4b-f618-498e-8847-2d620e286838 --- Chan.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Chan.cpp b/Chan.cpp index 797eaa80..15c3561a 100644 --- a/Chan.cpp +++ b/Chan.cpp @@ -105,6 +105,7 @@ void CChan::Cycle() const { void CChan::JoinUser(bool bForce, const CString& sKey, CClient* pClient) { if (!bForce && (!IsOn() || !IsDetached())) { m_pUser->PutIRC("JOIN " + GetName() + " " + ((sKey.empty()) ? GetKey() : sKey)); + SetDetached(false); return; }