From e7bb3e5daa6b2c5ea969bc93d56f526aad933aba Mon Sep 17 00:00:00 2001 From: psychon Date: Tue, 1 Apr 2008 08:49:33 +0000 Subject: [PATCH] Remove an unused var from CClient If CClient::m_bAuthed was false, CClient::m_pUser was NULL as well and if it was true, m_pUser wasn't NULL, too. So why not take that var for this job? git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1003 726aef4b-f618-498e-8847-2d620e286838 --- Client.cpp | 11 +++++------ Client.h | 4 +--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Client.cpp b/Client.cpp index f9866e2c..428ae20a 100644 --- a/Client.cpp +++ b/Client.cpp @@ -35,7 +35,7 @@ void CClient::ReadLine(const CString& sData) { DEBUG_ONLY(cout << "(" << ((m_pUser) ? m_pUser->GetUserName() : CString("")) << ") CLI -> ZNC [" << sLine << "]" << endl); #ifdef _MODULES - if (m_bAuthed) { + if (IsAttached()) { MODULECALL(OnUserRaw(sLine), m_pUser, this, return); } #endif @@ -43,7 +43,7 @@ void CClient::ReadLine(const CString& sData) { CString sCommand = sLine.Token(0); if (sCommand.CaseCmp("PASS") == 0) { - if (!m_bAuthed) { + if (!IsAttached()) { m_bGotPass = true; m_sPass = sLine.Token(1); @@ -64,7 +64,7 @@ void CClient::ReadLine(const CString& sData) { sNick.LeftChomp(); } - if (!m_bAuthed) { + if (!IsAttached()) { m_sNick = sNick; m_bGotNick = true; @@ -96,7 +96,7 @@ void CClient::ReadLine(const CString& sData) { } } } else if (sCommand.CaseCmp("USER") == 0) { - if (!m_bAuthed) { + if (!IsAttached()) { if (m_sUser.empty()) { m_sUser = sLine.Token(1); } @@ -1841,7 +1841,6 @@ void CClient::AcceptLogin(CUser& User) { return; } - m_bAuthed = true; SetSockName("USR::" + m_pUser->GetUserName()); m_pIRCSock = (CIRCSock*) CZNC::Get().FindSockByName("IRC::" + m_pUser->GetUserName()); @@ -1934,7 +1933,7 @@ void CClient::PutModule(const CString& sModule, const CString& sLine) { CString CClient::GetNick(bool bAllowIRCNick) const { CString sRet; - if ((bAllowIRCNick) && (m_bAuthed) && (m_pIRCSock)) { + if ((bAllowIRCNick) && (IsAttached()) && (m_pIRCSock)) { sRet = m_pIRCSock->GetNick(); } diff --git a/Client.h b/Client.h index 04b8a0b7..e88e0ca3 100644 --- a/Client.h +++ b/Client.h @@ -78,7 +78,6 @@ public: void InitClient() { m_pUser = NULL; m_pIRCSock = NULL; - m_bAuthed = false; m_bGotPass = false; m_bGotNick = false; m_bGotUser = false; @@ -102,7 +101,7 @@ public: void IRCConnected(CIRCSock* pIRCSock); void IRCDisconnected(); void BouncedOff(); - bool IsAttached() const { return m_bAuthed; } + bool IsAttached() const { return m_pUser != NULL; } void PutIRC(const CString& sLine); void PutClient(const CString& sLine); @@ -125,7 +124,6 @@ public: CUser* GetUser() const { return m_pUser; } private: protected: - bool m_bAuthed; bool m_bGotPass; bool m_bGotNick; bool m_bGotUser;