Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

DETACH should support the same syntax as PART (except no message)

Closes #225, this isn't the same as #225, but `/msg *status detach` is
something different, since it supports wildcard matching.
  • Loading branch information...
commit 9e7110175ac2a12eb66f41239a15e62ba2d0eb74 1 parent 369f93c
@kylef kylef authored
Showing with 18 additions and 7 deletions.
  1. +18 −7 src/Client.cpp
View
25 src/Client.cpp
@@ -380,20 +380,31 @@ void CClient::ReadLine(const CString& sData) {
}
if (sCommand.Equals("DETACH")) {
- CString sChan = sLine.Token(1);
+ CString sChannels = sLine.Token(1).TrimPrefix_n();
- if (sChan.empty()) {
+ if (sChannels.empty()) {
PutStatusNotice("Usage: /detach <#chan>");
return;
}
- CChan* pChan = m_pNetwork->FindChan(sChan);
- if (!pChan) {
- PutStatusNotice("You are not on [" + sChan + "]");
- return;
+ VCString vChans;
+ sChannels.Split(",", vChans, false);
+ sChannels.clear();
+
+ for (VCString::const_iterator channelIterator = vChans.begin();
+ channelIterator != vChans.end();
+ ++channelIterator)
+ {
+ CString sChannel = *channelIterator;
+
+ CChan *pChannel = m_pNetwork->FindChan(sChannel);
+ if (pChannel) {
+ pChannel->DetachUser();
+ } else {
+ PutStatusNotice("You are not on [" + sChannel + "]");
+ }
}
- pChan->DetachUser();
return;
} else if (sCommand.Equals("JOIN")) {
CString sChans = sLine.Token(1).TrimPrefix_n();
Please sign in to comment.
Something went wrong with that request. Please try again.