mirror of
https://github.com/znc/znc.git
synced 2026-08-04 07:53:39 +02:00
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:
+3
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user