00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "stdinc.h"
00026 #include "tools.h"
00027 #include "handlers.h"
00028 #include "channel.h"
00029 #include "channel_mode.h"
00030 #include "client.h"
00031 #include "common.h"
00032 #include "hash.h"
00033 #include "irc_string.h"
00034 #include "ircd.h"
00035 #include "list.h"
00036 #include "numeric.h"
00037 #include "send.h"
00038 #include "s_serv.h"
00039 #include "s_conf.h"
00040 #include "msg.h"
00041 #include "parse.h"
00042 #include "modules.h"
00043
00044
00045 static void mo_classlist(struct Client *, struct Client *, int, char *[]);
00046
00047 struct Message classlist_msgtab = {
00048 "CLASSLIST", 0, 0, 2, 0, MFLG_SLOW, 0,
00049 {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_classlist, m_ignore}
00050 };
00051
00052 #ifndef STATIC_MODULES
00053 void
00054 _modinit(void)
00055 {
00056 mod_add_cmd(&classlist_msgtab);
00057 }
00058
00059 void
00060 _moddeinit(void)
00061 {
00062 mod_del_cmd(&classlist_msgtab);
00063 }
00064
00065 const char *_version = "$Revision: 33 $";
00066 #endif
00067
00068
00069
00070
00071
00072
00073 static void
00074 mo_classlist(struct Client *client_p, struct Client *source_p,
00075 int parc, char *parv[])
00076 {
00077 const dlink_node *ptr = NULL;
00078 int found_class = 0;
00079
00080 if (EmptyString(parv[1]))
00081 {
00082 sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
00083 me.name, source_p->name, "CLASSLIST");
00084 return;
00085 }
00086
00087 DLINK_FOREACH(ptr, class_items.head)
00088 {
00089 struct ConfItem *conf = ptr->data;
00090
00091 if (match(parv[1], conf->name))
00092 {
00093 const struct ClassItem *aclass = map_to_conf(conf);
00094 sendto_one(source_p, ":%s NOTICE %s :%s %d",
00095 me.name, source_p->name, conf->name,
00096 CurrUserCount(aclass));
00097 found_class = 1;
00098 }
00099 }
00100
00101 if (!found_class)
00102 sendto_one(source_p, ":%s NOTICE %s :No Class found matching %s",
00103 me.name, source_p->name, parv[1]);
00104 }