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.
This commit is contained in:
Kyle Fuller
2011-10-19 11:14:12 +00:00
parent 8659d7224a
commit 7e5144df04
+3 -2
View File
@@ -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;