From 56f2354ecc7bb0995c7be82466e5fd2e390000d5 Mon Sep 17 00:00:00 2001 From: special Date: Fri, 18 Aug 2006 00:52:04 +0000 Subject: Added glob pattern matching to /list, since the documentation says we have it git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@4939 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_list.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cmd_list.cpp') diff --git a/src/cmd_list.cpp b/src/cmd_list.cpp index e36653327..0862f77d0 100644 --- a/src/cmd_list.cpp +++ b/src/cmd_list.cpp @@ -33,6 +33,7 @@ using namespace std; #include "hashcomp.h" #include "typedefs.h" #include "cmd_list.h" +#include "wildcard.h" extern chan_hash chanlist; @@ -41,6 +42,9 @@ void cmd_list::Handle (char **parameters, int pcnt, userrec *user) WriteServ(user->fd,"321 %s Channel :Users Name",user->nick); for (chan_hash::const_iterator i = chanlist.begin(); i != chanlist.end(); i++) { + // If the user gave us a glob pattern, attempt to match it + if (pcnt && !match(i->second->name, parameters[0])) + continue; // if the channel is not private/secret, OR the user is on the channel anyway bool n = i->second->HasUser(user); if (((!(i->second->modes[CM_PRIVATE])) && (!(i->second->modes[CM_SECRET]))) || (n)) -- cgit v1.3.1-10-gc9f91