aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd_list.cpp
diff options
context:
space:
mode:
authorGravatar special2006-08-18 00:52:04 +0000
committerGravatar special2006-08-18 00:52:04 +0000
commit56f2354ecc7bb0995c7be82466e5fd2e390000d5 (patch)
tree9b106a6702a768c09296571a8b6c29390ebd3947 /src/cmd_list.cpp
parentOptimizations (diff)
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
Diffstat (limited to 'src/cmd_list.cpp')
-rw-r--r--src/cmd_list.cpp4
1 files changed, 4 insertions, 0 deletions
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))