Skip to content

Commit

Permalink
Fix CUser::IsUserAttached().
Browse files Browse the repository at this point in the history
It honored only clients connected without any network.

Thanks to Cronus` for reporting this.
  • Loading branch information
Alexey Sokolov committed Sep 24, 2011
1 parent 4b1e714 commit ceeebf7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions User.cpp
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion User.h
Expand Up @@ -81,7 +81,7 @@ class CUser {
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);

Expand Down

0 comments on commit ceeebf7

Please sign in to comment.