]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_list.cpp
Fix for parameters which contain a colon (which is not the first char in the string)
[user/henk/code/inspircd.git] / src / cmd_list.cpp
index 26fa3cc10becf9a57060971b3efc9e92cf7133c5..066c80611fb311c99a5f670bebfe11a85d0dc3e2 100644 (file)
  */
 
 #include "users.h"
-#include "ctables.h"
-#include "commands.h"
-#include "helperfuncs.h"
 #include "inspircd.h"
 #include "commands/cmd_list.h"
-
-extern InspIRCd* ServerInstance;
+#include "wildcard.h"
 
 void cmd_list::Handle (const char** parameters, int pcnt, userrec *user)
 {
        user->WriteServ("321 %s Channel :Users Name",user->nick);
        for (chan_hash::const_iterator i = ServerInstance->chanlist.begin(); i != ServerInstance->chanlist.end(); i++)
        {
+               // attempt to match a glob pattern
+               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))
                {
-                       long users = usercount(i->second);
+                       long users = i->second->GetUserCounter();
                        if (users)
-                               user->WriteServ("322 %s %s %d :[+%s] %s",user->nick,i->second->name,users,chanmodes(i->second,n),i->second->topic);
+                               user->WriteServ("322 %s %s %d :[+%s] %s",user->nick,i->second->name,users,i->second->ChanModes(n),i->second->topic);
                }
        }
        user->WriteServ("323 %s :End of channel list.",user->nick);