Permalink
Browse files

Part the client from the channels they are in when they used /znc Jum…

…pNetwork
  • Loading branch information...
1 parent b3b4e08 commit d3ffdbb2a62c111c80705b42ca8254d27f248010 @kylef kylef committed Aug 24, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 Client.cpp
View
@@ -502,6 +502,14 @@ void CClient::SetNetwork(CIRCNetwork* pNetwork, bool bDisconnect, bool bReconnec
if (bDisconnect) {
if (m_pNetwork) {
m_pNetwork->ClientDisconnected(this);
+
+ // Tell the client they are no longer in these channels.
+ const vector<CChan*>& vChans = m_pNetwork->GetChans();
+ for (vector<CChan*>::const_iterator it = vChans.begin(); it != vChans.end(); ++it) {
+ if (!((*it)->IsDetached())) {
+ PutClient(":" + m_pNetwork->GetIRCNick().GetNickMask() + " PART " + (*it)->GetName());
+ }
+ }
} else if (m_pUser) {
m_pUser->UserDisconnected(this);
}

0 comments on commit d3ffdbb

Please sign in to comment.