Allow a client to become "away"

The result of CIRCNetwork::IsUserOnline() will only show clients which
do not have the away state set. This value is not set from the IRC
command AWAY, but a future module could use this behaviour.

Some CIRCNetwork::IsUserAttached() checks are now moved into of
CIRCNetwork::IsUserOnline() checks.

This allows "away" clients to store buffer even if KeepBuffer is false.
This commit is contained in:
Kyle Fuller
2011-10-02 18:37:20 +00:00
parent 6ae491ca66
commit bce4e60c08
5 changed files with 25 additions and 8 deletions

View File

@@ -325,6 +325,18 @@ void CIRCNetwork::BounceAllClients() {
m_vClients.clear();
}
bool CIRCNetwork::IsUserOnline() const {
vector<CClient*>::const_iterator it;
for (it = m_vClients.begin(); it != m_vClients.end(); ++it) {
CClient *pClient = *it;
if (!pClient->IsAway()) {
return true;
}
}
return false;
}
void CIRCNetwork::ClientConnected(CClient *pClient) {
if (!m_pUser->MultiClients()) {
BounceAllClients();