From 6a55c3a0ee993427a3fec81ba5532969c8088624 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Sat, 22 Dec 2012 17:41:24 +0000 Subject: [PATCH] Make /znc detach case insensitive Closes #213 --- src/ClientCommand.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ClientCommand.cpp b/src/ClientCommand.cpp index 67caf40b..e7639f7f 100644 --- a/src/ClientCommand.cpp +++ b/src/ClientCommand.cpp @@ -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::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++;