From 7f1feb3cb7dbddb94d5531dbb5dbb852ae78f009 Mon Sep 17 00:00:00 2001 From: psychon Date: Tue, 18 Sep 2007 14:39:54 +0000 Subject: [PATCH] Don't handle USER lines at all when the client is already logged in. Fix bug 1797023 from sf.net bug tracker. Thanks to Zigara. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@840 726aef4b-f618-498e-8847-2d620e286838 --- Client.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Client.cpp b/Client.cpp index f18fd887..4a11890d 100644 --- a/Client.cpp +++ b/Client.cpp @@ -50,9 +50,9 @@ void CClient::ReadLine(const CString& sData) { if ((m_bGotNick) && (m_bGotUser)) { AuthUser(); } - } - return; // Don't forward this msg. ZNC has already registered us. + return; // Don't forward this msg. ZNC has already registered us. + } } else if (sCommand.CaseCmp("NICK") == 0) { CString sNick = sLine.Token(1); if (sNick.Left(1) == ":") { @@ -91,19 +91,23 @@ void CClient::ReadLine(const CString& sData) { } } } else if (sCommand.CaseCmp("USER") == 0) { - if ((!m_bAuthed) && (m_sUser.empty())) { - m_sUser = sLine.Token(1); + if (!m_bAuthed) { + if (m_sUser.empty()) { + m_sUser = sLine.Token(1); + } + + m_bGotUser = true; + + if ((m_bGotPass) && (m_bGotNick)) { + AuthUser(); + } else if (!m_bGotPass) { + PutClient(":irc.znc.com NOTICE AUTH :*** " + + "You need to send your password. " + + "Try /quote PASS :"); + } + + return; // Don't forward this msg. ZNC has already registered us. } - - m_bGotUser = true; - - if ((m_bGotPass) && (m_bGotNick)) { - AuthUser(); - } else if (!m_bGotPass) { - PutClient(":irc.znc.com NOTICE AUTH :*** You need to send your password. Try /quote PASS :"); - } - - return; // Don't forward this msg. ZNC has already registered us. } if (!m_pUser) {