Fix CUser::IsUserAttached().

It honored only clients connected without any network.

Thanks to Cronus` for reporting this.
This commit is contained in:
Alexey Sokolov
2011-09-25 02:35:37 +07:00
parent 4b1e7143c3
commit ceeebf746b
2 changed files with 15 additions and 1 deletions

View File

@@ -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; }