diff --git a/Client.cpp b/Client.cpp index d269e414..88aa22e1 100644 --- a/Client.cpp +++ b/Client.cpp @@ -1979,9 +1979,14 @@ CString CClient::GetNick(bool bAllowIRCNick) const { } CString CClient::GetNickMask() const { - if (m_pIRCSock) { + if (m_pIRCSock && m_pIRCSock->IsAuthed()) { return m_pIRCSock->GetNickMask(); } - return GetNick() + "!" + m_pUser->GetIdent() + "@" + m_pUser->GetVHost(); + CString sHost = m_pUser->GetVHost(); + if (sHost.empty()) { + sHost = "irc.znc.com"; + } + + return GetNick() + "!" + m_pUser->GetIdent() + "@" + sHost; } diff --git a/IRCSock.h b/IRCSock.h index 9df048d3..9c7ac20d 100644 --- a/IRCSock.h +++ b/IRCSock.h @@ -77,6 +77,8 @@ public: bool HasNamesx() const { return m_bNamesx; } bool HasUHNames() const { return m_bUHNames; } const set& GetUserModes() const { return m_scUserModes; } + // This is true if we are past raw 001 + bool IsAuthed() const { return m_bAuthed; } // !Getters private: void SetNick(const CString& sNick); diff --git a/User.cpp b/User.cpp index 3d50f995..93bd282d 100644 --- a/User.cpp +++ b/User.cpp @@ -119,6 +119,8 @@ void CUser::IRCDisconnected() { m_vClients[a]->IRCDisconnected(); } + SetIRCServer(""); + // Get the reconnect going CZNC::Get().EnableConnectUser(); }