From f6f4e6a6f8ace5f4cab24aec767908699f406649 Mon Sep 17 00:00:00 2001 From: psychon Date: Sun, 13 Jun 2010 07:15:35 +0000 Subject: [PATCH] Move some common code into CClient::AuthUser() git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2021 726aef4b-f618-498e-8847-2d620e286838 --- Client.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Client.cpp b/Client.cpp index c7ebff5f..25012dcc 100644 --- a/Client.cpp +++ b/Client.cpp @@ -92,10 +92,7 @@ void CClient::ReadLine(const CString& sData) { m_sPass = m_sPass.Token(1, true, ":"); } - if ((m_bGotNick) && (m_bGotUser)) { - AuthUser(); - } - + AuthUser(); return; // Don't forward this msg. ZNC has already registered us. } } else if (sCommand.Equals("NICK")) { @@ -108,9 +105,7 @@ void CClient::ReadLine(const CString& sData) { m_sNick = sNick; m_bGotNick = true; - if ((m_bGotPass) && (m_bGotUser)) { - AuthUser(); - } + AuthUser(); return; // Don't forward this msg. ZNC will handle nick changes until auth is complete } } else if (sCommand.Equals("USER")) { @@ -121,9 +116,9 @@ void CClient::ReadLine(const CString& sData) { m_bGotUser = true; - if ((m_bGotPass) && (m_bGotNick)) { + if (m_bGotPass) { AuthUser(); - } else if (!m_bGotPass) { + } else { PutClient(":irc.znc.in NOTICE AUTH :*** " "You need to send your password. " "Try /quote PASS :"); @@ -593,6 +588,9 @@ bool CClient::SendMotd() { } void CClient::AuthUser() { + if (!m_bGotNick || !m_bGotUser) + return; + m_spAuth = new CClientAuth(this, m_sUser, m_sPass); CZNC::Get().AuthUser(m_spAuth);