1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
19 #include "inspircd_config.h"
21 #include "inspircd_io.h"
24 #include <ext/hash_map>
35 #include "inspstring.h"
36 #include "helperfuncs.h"
41 extern chan_hash chanlist;
43 void cmd_list::Handle (char **parameters, int pcnt, userrec *user)
45 WriteServ(user->fd,"321 %s Channel :Users Name",user->nick);
46 for (chan_hash::const_iterator i = chanlist.begin(); i != chanlist.end(); i++)
48 // if the channel is not private/secret, OR the user is on the channel anyway
49 if (((!(i->second->binarymodes & CM_PRIVATE)) && (!(i->second->binarymodes & CM_SECRET))) || (has_channel(user,i->second)))
51 WriteServ(user->fd,"322 %s %s %d :[+%s] %s",user->nick,i->second->name,usercount_i(i->second),chanmodes(i->second),i->second->topic);
54 WriteServ(user->fd,"323 %s :End of channel list.",user->nick);