CClient: share the chan detaching code

This commit is contained in:
J-P Nurmi
2015-09-08 00:11:40 +02:00
parent 7916efa997
commit 832430659f
3 changed files with 15 additions and 16 deletions

View File

@@ -121,14 +121,7 @@ void CClient::UserCommand(CString& sLine) {
}
set<CChan*> sChans = MatchChans(sPatterns);
unsigned int uDetached = 0;
for (CChan* pChan : sChans) {
if (pChan->IsDetached())
continue;
uDetached++;
pChan->DetachUser();
}
unsigned int uDetached = DetachChans(sChans);
PutStatus("There were [" + CString(sChans.size()) + "] channels matching [" + sPatterns + "]");
PutStatus("Detached [" + CString(uDetached) + "] channels");