From 7e5144df04218ae20b139b0b38608d6355f060b3 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Wed, 19 Oct 2011 11:14:12 +0000 Subject: [PATCH] Make sure a IRCSock is authed before we use the nick This fixes a bug where an unauthed IRC connection will cause your clients nick to be the default nick. But this is before we update the client to use this nick. If a client tried another nick when connecting then they are still expecting this nick. --- src/Client.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Client.cpp b/src/Client.cpp index 381f16e4..4773ab8f 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -731,8 +731,9 @@ void CClient::PutModule(const CString& sModule, const CString& sLine) { CString CClient::GetNick(bool bAllowIRCNick) const { CString sRet; - if ((bAllowIRCNick) && (IsAttached()) && (GetIRCSock())) { - sRet = GetIRCSock()->GetNick(); + const CIRCSock *pSock = GetIRCSock(); + if (bAllowIRCNick && pSock && pSock->IsAuthed()) { + sRet = pSock->GetNick(); } return (sRet.empty()) ? m_sNick : sRet;