Merge branch 'master' of github.com:znc/znc

This commit is contained in:
Alexey Sokolov
2012-12-25 00:29:25 +07:00
3 changed files with 26 additions and 9 deletions
+3
View File
@@ -38,3 +38,6 @@ __pycache__
# Compiled Dynamic libraries
*.so
# Makefile generates this
.version_extra
+18 -7
View File
@@ -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();
+5 -2
View File
@@ -106,7 +106,7 @@ void CClient::UserCommand(CString& sLine) {
return;
}
CString sChan = sLine.Token(1);
CString sChan = sLine.Token(1).MakeLower();
if (sChan.empty()) {
PutStatus("Usage: Detach <#chan>");
@@ -117,7 +117,10 @@ void CClient::UserCommand(CString& sLine) {
vector<CChan*>::const_iterator it;
unsigned int uMatches = 0, uDetached = 0;
for (it = vChans.begin(); it != vChans.end(); ++it) {
if (!(*it)->GetName().WildCmp(sChan))
CChan *pChannel = *it;
CString channelName = pChannel->GetName().AsLower();
if (!channelName.WildCmp(sChan))
continue;
uMatches++;