mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
Make CClient::GetNickMask() always return a valid nickmask
The recent removal of CUser::m_bIRCConnected lead to a bug here which is now fixed. In addition to this, this function now also works properly for users without a vhost. Oh and in User.cpp: Make sure CUser::GetIRCServer() returns an empty string when we are no longer connected to an IRCd. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1134 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+7
-2
@@ -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;
|
||||
}
|
||||
|
||||
@@ -77,6 +77,8 @@ public:
|
||||
bool HasNamesx() const { return m_bNamesx; }
|
||||
bool HasUHNames() const { return m_bUHNames; }
|
||||
const set<unsigned char>& 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);
|
||||
|
||||
Reference in New Issue
Block a user