From 90f741d2caf62bcdd78b282cf1038a9bdd4efb08 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Fri, 29 Jul 2011 19:21:25 +0100 Subject: [PATCH] Make the CUser::IsIRCConnected method check if the IRC connection is authed because may of its callers expect this behaviour. This fixes a bug reported by Robby where a channel could become disabled while a the user is connected to irc, but before they have authenticated. --- User.cpp | 2 +- User.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/User.cpp b/User.cpp index 6e4d4458..a906ed91 100644 --- a/User.cpp +++ b/User.cpp @@ -388,7 +388,7 @@ void CUser::SetIRCSocket(CIRCSock* pIRCSock) { bool CUser::IsIRCConnected() const { const CIRCSock* pSock = GetIRCSock(); - return (pSock && pSock->IsConnected()); + return (pSock && pSock->IsAuthed()); } void CUser::IRCDisconnected() { diff --git a/User.h b/User.h index e61ca75d..3cbd142d 100644 --- a/User.h +++ b/User.h @@ -110,6 +110,9 @@ public: CString GetLocalIP(); CString GetLocalDCCIP(); + + /** This method will return whether the user is connected and authenticated to an IRC server. + */ bool IsIRCConnected() const; void SetIRCSocket(CIRCSock* pIRCSock); void IRCDisconnected();