Permalink
Browse files

Fix CUser::IsUserAttached().

It honored only clients connected without any network.

Thanks to Cronus` for reporting this.
  • Loading branch information...
1 parent 4b1e714 commit ceeebf746b31e973695fd78a129fe49310b520cd Alexey Sokolov committed Sep 24, 2011
Showing with 15 additions and 1 deletion.
  1. +14 −0 User.cpp
  2. +1 −1 User.h
View
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; }
View
2 User.h
@@ -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);

0 comments on commit ceeebf7

Please sign in to comment.