Permalink
Browse files

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.
  • Loading branch information...
1 parent 8659d72 commit 7e5144df04218ae20b139b0b38608d6355f060b3 @kylef kylef committed Oct 19, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/Client.cpp
View
@@ -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;

0 comments on commit 7e5144d

Please sign in to comment.