mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix CUser::IsUserAttached().
It honored only clients connected without any network. Thanks to Cronus` for reporting this.
This commit is contained in:
14
User.cpp
14
User.cpp
@@ -991,6 +991,20 @@ CString CUser::MakeCleanUserName(const CString& sUserName) {
|
||||
return sUserName.Token(0, false, "@").Replace_n(".", "");
|
||||
}
|
||||
|
||||
bool CUser::IsUserAttached() const {
|
||||
if (!m_vClients.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (vector<CIRCNetwork*>::const_iterator i = m_vIRCNetworks.begin(); i != m_vIRCNetworks.end(); ++i) {
|
||||
if ((*i)->IsUserAttached()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Setters
|
||||
void CUser::SetNick(const CString& s) { m_sNick = s; }
|
||||
void CUser::SetAltNick(const CString& s) { m_sAltNick = s; }
|
||||
|
||||
2
User.h
2
User.h
@@ -81,7 +81,7 @@ public:
|
||||
bool PutModule(const CString& sModule, const CString& sLine, CClient* pClient = NULL, CClient* pSkipClient = NULL);
|
||||
bool PutModNotice(const CString& sModule, const CString& sLine, CClient* pClient = NULL, CClient* pSkipClient = NULL);
|
||||
|
||||
bool IsUserAttached() const { return !m_vClients.empty(); }
|
||||
bool IsUserAttached() const;
|
||||
void UserConnected(CClient* pClient);
|
||||
void UserDisconnected(CClient* pClient);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user