From bf3acfe88a793d288dd0cbf3dc5a1c35353996af Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 14 Jul 2008 08:19:57 +0000 Subject: [PATCH] Remove CUser::m_bIRCConnected CUser::GetIRCSock() != NULL is the replacement. This is a small chance in sematics. Before this, a user only counted as connected to IRC when the 001 numeric was received. Now it already counts as connected when the connection was established. This change doesn't hurt any of the current users of CUser::IsIRCConnected() and so this change should be fine. Yay, one var less ;) git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1131 726aef4b-f618-498e-8847-2d620e286838 --- User.cpp | 5 +---- User.h | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/User.cpp b/User.cpp index a0a8a134..3d50f995 100644 --- a/User.cpp +++ b/User.cpp @@ -30,7 +30,6 @@ CUser::CUser(const CString& sUserName) { #endif m_RawBuffer.SetLineCount(100); // This should be more than enough raws, especially since we are buffering the MOTD separately m_MotdBuffer.SetLineCount(200); // This should be more than enough motd lines - m_bIRCConnected = false; m_bMultiClients = true; m_bBounceDCCs = true; m_bPassHashed = false; @@ -114,8 +113,6 @@ void CUser::IRCConnected(CIRCSock* pIRCSock) { } void CUser::IRCDisconnected() { - m_bIRCConnected = false; - m_pIRCSock = NULL; for (unsigned int a = 0; a < m_vClients.size(); a++) { @@ -1038,7 +1035,7 @@ void CUser::SetDenyLoadMod(bool b) { m_bDenyLoadMod = b; } void CUser::SetAdmin(bool b) { m_bAdmin = b; } void CUser::SetDenySetVHost(bool b) { m_bDenySetVHost = b; } void CUser::SetDefaultChanModes(const CString& s) { m_sDefaultChanModes = s; } -void CUser::SetIRCServer(const CString& s) { m_sIRCServer = s; m_bIRCConnected = true; } +void CUser::SetIRCServer(const CString& s) { m_sIRCServer = s; } void CUser::SetQuitMsg(const CString& s) { m_sQuitMsg = s; } void CUser::SetBufferCount(unsigned int u) { m_uBufferCount = u; } void CUser::SetKeepBuffer(bool b) { m_bKeepBuffer = b; } diff --git a/User.h b/User.h index 35b45c41..32c14b75 100644 --- a/User.h +++ b/User.h @@ -91,7 +91,7 @@ public: void UserDisconnected(CClient* pClient); CString GetLocalIP(); - bool IsIRCConnected() const { return m_bIRCConnected; } + bool IsIRCConnected() const { return GetIRCSock() != NULL; } void IRCConnected(CIRCSock* pIRCSock); void IRCDisconnected(); void CheckIRCConnect(); @@ -227,7 +227,6 @@ protected: CBuffer m_RawBuffer; CBuffer m_MotdBuffer; CBuffer m_QueryBuffer; - bool m_bIRCConnected; bool m_bMultiClients; bool m_bBounceDCCs; bool m_bPassHashed;