]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blame - cmdhelp.patch
Update patchset for latest ircu changes
[irc/quakenet/snircd-patchqueue.git] / cmdhelp.patch
CommitLineData
a037f551 1Add /HELP <command>
12e82c05 2
a037f551 3include/handlers.h
4include/ircd_handler.h
5include/msg.h
6add mh_* message help function handlers
7
8ircd/m_defaults.c
9add default replies for /HELP (mh_not_oper mh_not_server)
10
11ircd/m_help.c
12add mh_* functions - once finished they should be moved to their respective m_*.c files
13
14include/numeric.h
15ircd/s_err.c
16add 377 RPL_HELP, 378 RPL_ENDOFHELP, 418 ERR_NOHELP
17
18include/parse.h
19add function find_message_by_cmd to find the mh_* function to call
20
21ircd/parse.c
22add mh_* functions in the message table
23
efbd1f63 24diff -r 5a1e5e09c766 include/handlers.h
25--- a/include/handlers.h Sat Jan 31 18:46:47 2009 +0100
26+++ b/include/handlers.h Sat Jan 31 18:51:08 2009 +0100
cddf800b 27@@ -244,5 +244,77 @@
28 extern int ms_wallvoices(struct Client*, struct Client*, int, char*[]);
29 extern int ms_whois(struct Client*, struct Client*, int, char*[]);
30
31+extern int mh_nohelp(struct Client*, struct Client*, int, char*[]);
32+extern int mh_not_oper(struct Client*, struct Client*, int, char*[]);
33+extern int mh_not_server(struct Client*, struct Client*, int, char*[]);
34+extern int mh_admin(struct Client*, struct Client*, int, char*[]);
35+extern int mh_asll(struct Client*, struct Client*, int, char*[]);
36+extern int mh_away(struct Client*, struct Client*, int, char*[]);
37+extern int mh_check(struct Client*, struct Client*, int, char*[]);
38+extern int mh_clearmode(struct Client*, struct Client*, int, char*[]);
39+extern int mh_close(struct Client*, struct Client*, int, char*[]);
40+extern int mh_cnotice(struct Client*, struct Client*, int, char*[]);
41+extern int mh_connect(struct Client*, struct Client*, int, char*[]);
42+extern int mh_cprivmsg(struct Client*, struct Client*, int, char*[]);
43+extern int mh_die(struct Client*, struct Client*, int, char*[]);
44+extern int mh_get(struct Client*, struct Client*, int, char*[]);
45+extern int mh_gline(struct Client*, struct Client*, int, char*[]);
46+extern int mh_hash(struct Client*, struct Client*, int, char*[]);
47+extern int mh_help(struct Client*, struct Client*, int, char*[]);
48+extern int mh_info(struct Client*, struct Client*, int, char*[]);
49+extern int mh_invite(struct Client*, struct Client*, int, char*[]);
50+extern int mh_ison(struct Client*, struct Client*, int, char*[]);
51+extern int mh_join(struct Client*, struct Client*, int, char*[]);
52+extern int mh_jupe(struct Client*, struct Client*, int, char*[]);
53+extern int mh_kick(struct Client*, struct Client*, int, char*[]);
54+extern int mh_kill(struct Client*, struct Client*, int, char*[]);
55+extern int mh_links(struct Client*, struct Client*, int, char*[]);
56+extern int mh_list(struct Client*, struct Client*, int, char*[]);
57+extern int mh_lusers(struct Client*, struct Client*, int, char*[]);
58+extern int mh_map(struct Client*, struct Client*, int, char*[]);
59+extern int mh_mode(struct Client*, struct Client*, int, char*[]);
60+extern int mh_motd(struct Client*, struct Client*, int, char*[]);
61+extern int mh_names(struct Client*, struct Client*, int, char*[]);
62+extern int mh_nick(struct Client*, struct Client*, int, char*[]);
63+extern int mh_notice(struct Client*, struct Client*, int, char*[]);
64+extern int mh_oper(struct Client*, struct Client*, int, char*[]);
65+extern int mh_opmode(struct Client*, struct Client*, int, char*[]);
66+extern int mh_part(struct Client*, struct Client*, int, char*[]);
67+extern int mh_pass(struct Client*, struct Client*, int, char*[]);
68+extern int mh_ping(struct Client*, struct Client*, int, char*[]);
69+extern int mh_pong(struct Client*, struct Client*, int, char*[]);
70+extern int mh_privmsg(struct Client*, struct Client*, int, char*[]);
71+extern int mh_privs(struct Client*, struct Client*, int, char*[]);
72+extern int mh_quit(struct Client*, struct Client*, int, char*[]);
73+extern int mh_rehash(struct Client*, struct Client*, int, char*[]);
74+extern int mh_reset(struct Client*, struct Client*, int, char*[]);
75+extern int mh_restart(struct Client*, struct Client*, int, char*[]);
76+extern int mh_rping(struct Client*, struct Client*, int, char*[]);
77+extern int mh_set(struct Client*, struct Client*, int, char*[]);
78+extern int mh_sethost(struct Client*, struct Client*, int, char*[]);
79+extern int mh_settime(struct Client*, struct Client*, int, char*[]);
80+extern int mh_silence(struct Client*, struct Client*, int, char*[]);
81+extern int mh_squit(struct Client*, struct Client*, int, char*[]);
82+extern int mh_stats(struct Client*, struct Client*, int, char*[]);
83+extern int mh_time(struct Client*, struct Client*, int, char*[]);
84+extern int mh_topic(struct Client*, struct Client*, int, char*[]);
85+extern int mh_trace(struct Client*, struct Client*, int, char*[]);
86+extern int mh_uping(struct Client*, struct Client*, int, char*[]);
87+extern int mh_user(struct Client*, struct Client*, int, char*[]);
88+extern int mh_userhost(struct Client*, struct Client*, int, char*[]);
89+extern int mh_userip(struct Client*, struct Client*, int, char*[]);
90+extern int mh_version(struct Client*, struct Client*, int, char*[]);
91+extern int mh_wallchops(struct Client*, struct Client*, int, char*[]);
92+extern int mh_wallops(struct Client*, struct Client*, int, char*[]);
93+extern int mh_wallusers(struct Client*, struct Client*, int, char*[]);
94+extern int mh_wallvoices(struct Client*, struct Client*, int, char*[]);
95+extern int mh_who(struct Client*, struct Client*, int, char*[]);
96+extern int mh_whois(struct Client*, struct Client*, int, char*[]);
97+extern int mh_whowas(struct Client*, struct Client*, int, char*[]);
98+
99+
100+
101+
102+
103 #endif /* INCLUDED_handlers_h */
104
efbd1f63 105diff -r 5a1e5e09c766 include/ircd_handler.h
106--- a/include/ircd_handler.h Sat Jan 31 18:46:47 2009 +0100
107+++ b/include/ircd_handler.h Sat Jan 31 18:51:08 2009 +0100
cddf800b 108@@ -36,6 +36,7 @@
109 SERVER_HANDLER, /**< Used for server conections. */
110 OPER_HANDLER, /**< Used for IRC operators. */
111 SERVICE_HANDLER, /**< Used for services connections. */
112+ HELP_HANDLER, /**< Used for /HELP <command> */
113 LAST_HANDLER_TYPE /**< NUmber of handler types. */
114 } HandlerType;
115
efbd1f63 116diff -r 5a1e5e09c766 include/msg.h
117--- a/include/msg.h Sat Jan 31 18:46:47 2009 +0100
118+++ b/include/msg.h Sat Jan 31 18:51:08 2009 +0100
cddf800b 119@@ -410,7 +410,7 @@
120 * parv = parameter variable array
121 */
122 /* handlers:
123- * UNREGISTERED, CLIENT, SERVER, OPER, SERVICE, LAST
124+ * UNREGISTERED, CLIENT, SERVER, OPER, SERVICE, HELP, LAST
125 */
126 MessageHandler handlers[LAST_HANDLER_TYPE];
127 };
efbd1f63 128diff -r 5a1e5e09c766 include/numeric.h
129--- a/include/numeric.h Sat Jan 31 18:46:47 2009 +0100
130+++ b/include/numeric.h Sat Jan 31 18:51:08 2009 +0100
a037f551 131@@ -292,6 +292,9 @@
132 #define RPL_MOTDSTART 375
133 #define RPL_ENDOFMOTD 376
134
135+#define RPL_HELP 377 /* QuakeNet extension */
136+#define RPL_ENDOFHELP 378 /* QuakeNet extension */
137+
138 /* RPL_KICKEXPIRED 377 aircd */
139 /* RPL_SPAM 377 austnet */
140 /* RPL_BANEXPIRED 378 aircd */
141@@ -342,6 +345,7 @@
142 #define ERR_QUERYTOOLONG 416 /* Undernet extension */
143 /* ERR_TOOMANYMATCHES 416 IRCnet extension */
144 #define ERR_INPUTTOOLONG 417
145+#define ERR_NOHELP 418 /* QuakeNet extension */
146 /* ERR_LENGTHTRUNCATED 419 aircd */
147
148 #define ERR_UNKNOWNCOMMAND 421
149@@ -476,7 +480,6 @@
cddf800b 150 #define ERR_NOMANAGER 566 /* Undernet extension */
151 #define ERR_UPASS_SAME_APASS 567 /* Undernet extension */
a037f551 152 #define ERR_LASTERROR 568
153-
cddf800b 154 /* RPL_LOGON 600 dalnet,unreal
155 RPL_LOGOFF 601 dalnet,unreal
a037f551 156 RPL_WATCHOFF 602 dalnet,unreal
efbd1f63 157diff -r 5a1e5e09c766 include/parse.h
158--- a/include/parse.h Sat Jan 31 18:46:47 2009 +0100
159+++ b/include/parse.h Sat Jan 31 18:51:08 2009 +0100
cddf800b 160@@ -15,6 +15,7 @@
161 extern int parse_client(struct Client *cptr, char *buffer, char *bufend);
162 extern int parse_server(struct Client *cptr, char *buffer, char *bufend);
163 extern void initmsgtree(void);
164+extern struct Message *find_message_by_cmd(char *cmd);
165
166 extern int register_mapping(struct s_map *map);
167 extern int unregister_mapping(struct s_map *map);
efbd1f63 168diff -r 5a1e5e09c766 ircd/m_defaults.c
169--- a/ircd/m_defaults.c Sat Jan 31 18:46:47 2009 +0100
170+++ b/ircd/m_defaults.c Sat Jan 31 18:51:08 2009 +0100
cddf800b 171@@ -119,3 +119,18 @@
172 {
173 return 0;
174 }
175+
176+int mh_nohelp(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
177+{
178+ return send_reply(sptr, ERR_NOHELP, parv[1]);
179+}
180+
181+int mh_not_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
182+{
183+ return send_reply(sptr, SND_EXPLICIT | RPL_HELP, "%s :This command is for IRC Operators only.", parv[1]);
184+}
185+
186+int mh_not_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
187+{
188+ return send_reply(sptr, SND_EXPLICIT | RPL_HELP, "%s :This command is for servers only.", parv[1]);
189+}
efbd1f63 190diff -r 5a1e5e09c766 ircd/m_help.c
191--- a/ircd/m_help.c Sat Jan 31 18:46:47 2009 +0100
192+++ b/ircd/m_help.c Sat Jan 31 18:51:08 2009 +0100
193@@ -82,6 +82,7 @@
194 #include "config.h"
195
196 #include "client.h"
197+#include "handlers.h"
198 #include "hash.h"
199 #include "ircd.h"
200 #include "ircd_log.h"
201@@ -90,6 +91,7 @@
cddf800b 202 #include "msg.h"
203 #include "numeric.h"
204 #include "numnicks.h"
205+#include "parse.h"
206 #include "send.h"
207
208 /* #include <assert.h> -- Now using assert in ircd_log.h */
efbd1f63 209@@ -100,9 +102,1212 @@
12e82c05 210 int m_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
211 {
212 int i;
cddf800b 213+ struct Message* mptr;
214+ MessageHandler handler = 0;
215+ char *command;
216
217- for (i = 0; msgtab[i].cmd; i++)
218- sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd);
219+ /* list all commands */
220+ if (parc < 2) {
221+ for (i = 0; msgtab[i].cmd; i++)
222+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd);
223+ return 0;
224+ }
225+ command = parv[1];
226+
227+ /* nothing found */
228+ if ((mptr = find_message_by_cmd(command)) == NULL)
229+ return send_reply(sptr, ERR_NOHELP, command);
230+
231+ /* found a help handler function */
232+ handler = mptr->handlers[HELP_HANDLER];
233+
234+ assert(0 != handler);
235+
236+ /* call the help handler function */
237+ (*handler) (cptr, sptr, parc, parv);
238+ return send_reply(sptr, RPL_ENDOFHELP, command);
239+}
240+
241+
242+/*
243+ * mh_help - help message handler
244+ */
245+int mh_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
246+{
247+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
248+ "HELP :HELP [<command>]");
249+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
250+ "HELP :Lists all server commands or info on the given command.");
12e82c05 251 return 0;
cddf800b 252 }
12e82c05 253
cddf800b 254+
255+/*
256+ * TODO: move all the mh_ functions into the files of the commands they belong to
257+ */
258+
259+
260+/*
261+ * mh_admin - help message handler
262+ * TODO: check HIS remote
263+ */
264+int mh_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
265+{
266+ if (!IsAnOper(sptr))
267+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
268+ "ADMIN :ADMIN");
269+ else
270+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
271+ "ADMIN :ADMIN [<server>]");
272+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
273+ "ADMIN :Shows administrative contact for the server.");
274+ return 0;
275+}
276+
277+
278+/*
279+ * mh_asll - help message handler
280+ */
281+int mh_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
282+{
283+ if (!IsAnOper(sptr))
284+ return mh_not_oper(cptr, sptr, parc, parv);
285+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
286+ "ASLL :ASLL <mask> [<server>]");
287+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
288+ "ASLL :Shows Asymmetric Link Latency information.");
289+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
290+ "ASLL :Parameter <mask> is matched against directly linked servers, and may have more than one match.");
291+ return 0;
292+}
293+
294+
295+/*
296+ * mh_away - help message handler
297+ */
298+int mh_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
299+{
300+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
301+ "AWAY :AWAY [<message>]");
302+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
303+ "AWAY :Sets or clears the away message.");
304+ return 0;
305+}
306+
307+
308+/*
309+ * mh_check - help message handler
310+ */
311+int mh_check(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
312+{
313+ if (!IsAnOper(sptr))
314+ return mh_not_oper(cptr, sptr, parc, parv);
315+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
316+ "CHECK :CHECK [<server>] <mask> [<flags>]");
317+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
318+ "CHECK :Shows detailed information about a user, a channel, a hostmask, or a server.");
319+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
320+ "CHECK :Flags are: -C show clones, -c show channels, -s show servernames, -e show more, "
a87bc2c2 321+ "-i show IPs, -I show hostnames and IPs, -u do not show users, -o show only channel operators, -l show oplevels.");
cddf800b 322+ return 0;
323+}
324+
325+
326+/*
327+ * mh_clearmode - help message handler
328+ */
329+int mh_clearmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
330+{
331+ if (!IsAnOper(sptr))
332+ return mh_not_oper(cptr, sptr, parc, parv);
333+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
334+ "CLEARMODE :CLEARMODE [!]<channel> [<modes>]");
335+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
336+ "CLEARMODE :Clears modes on a channel.");
337+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
338+ "CLEARMODE :Default modes are ovpsmikbl - o deops all channel operators, "
339+ "v devoices all channel voices, and b removes all channel bans.");
340+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
341+ "CLEARMODE :The ! prefix may be used to override a channel quarantine.");
342+ return 0;
343+}
344+
345+
346+/*
347+ * mh_close - help message handler
348+ */
349+int mh_close(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
350+{
351+ if (!IsAnOper(sptr))
352+ return mh_not_oper(cptr, sptr, parc, parv);
353+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
354+ "CLOSE :CLOSE");
355+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
356+ "CLOSE :Closes unregistered connections to the server.");
357+ return 0;
358+}
359+
360+
361+/*
362+ * mh_cnotice - help message handler
363+ */
364+int mh_cnotice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
365+{
366+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
367+ "CNOTICE :CNOTICE <nick> <channel> :<message>");
368+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
369+ "CNOTICE :Sends a private notice to a user.");
370+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
371+ "CNOTICE :A channel voice or operator can use this to bypass the target flood limit "
372+ "(target change too fast error) when the user is on the channel.");
373+ return 0;
374+}
375+
376+
377+/*
378+ * mh_connect - help message handler
379+ */
380+int mh_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
381+{
382+ if (!IsAnOper(sptr))
383+ return mh_not_oper(cptr, sptr, parc, parv);
384+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
385+ "CONNECT :CONNECT <server> [<port> [<remote server>]]");
386+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
387+ "CONNECT :Connects the server to another server.");
388+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
389+ "CONNECT :Special port 0 can be used to let the remote server workout the port to use.");
390+ return 0;
391+}
392+
393+
394+/*
395+ * mh_cprivmsg - help message handler
396+ */
397+int mh_cprivmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
398+{
399+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
400+ "CPRIVMSG :CPRIVMSG <nick> <channel> :<message>");
401+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
402+ "CPRIVMSG :Sends a private message to a user.");
403+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
404+ "CPRIVMSG :A channel voice or operator can use this to bypass the target flood limit "
405+ "(target change too fast error) when the user is on the channel.");
406+ return 0;
407+}
408+
409+
410+/*
411+ * mh_die - help message handler
412+ */
413+int mh_die(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
414+{
415+ if (!IsAnOper(sptr))
416+ return mh_not_oper(cptr, sptr, parc, parv);
417+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
418+ "DIE :DIE <server>");
419+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
420+ "DIE :Terminates the server. The servername needs to be given as sanity check.");
421+ return 0;
422+}
423+
424+
425+/*
426+ * mh_get - help message handler
427+ * TODO: check HIS
428+ */
429+int mh_get(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
430+{
431+ if (!IsAnOper(sptr))
432+ return mh_not_oper(cptr, sptr, parc, parv);
433+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
434+ "GET :GET <feature> [<parameters>]");
435+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
436+ "GET :Returns the value of a feature.");
437+ return 0;
438+}
439+
440+
441+/*
442+ * mh_gline - help message handler
443+ * TODO: check HIS
444+ */
445+int mh_gline(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
446+{
447+ if (!IsAnOper(sptr))
448+ return mh_not_oper(cptr, sptr, parc, parv);
449+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
450+ "GLINE :GLINE [[!][+|-|>|<]<mask> [<target>] [<duration> [:<reason>]]]");
451+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
452+ "GLINE :Views, sets or changes a gline.");
453+ return 0;
454+}
455+
456+
457+/*
458+ * mh_hash - help message handler
459+ * TODO: check HIS
460+ */
461+int mh_hash(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
462+{
463+ if (!IsAnOper(sptr))
464+ return mh_not_oper(cptr, sptr, parc, parv);
465+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
466+ "HASH :HASH");
467+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
468+ "HASH :Shows hash table statistics.");
469+ return 0;
470+}
471+
472+
473+/*
474+ * mh_info - help message handler
475+ * TODO: check HIS remote
476+ */
477+int mh_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
478+{
479+ if (!IsAnOper(sptr)) {
480+ send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO");
481+ send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :Shows info about the IRCd.");
482+ return mh_not_oper(cptr, sptr, parc, parv);
483+ } else {
484+ send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO [<server>]");
485+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
486+ "INFO :Show info about the IRCd. Lists a file hash and version number for its source files.");
487+ }
488+ return 0;
489+}
490+
491+
492+/*
493+ * mh_invite - help message handler
494+ */
495+int mh_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
496+{
497+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
498+ "INVITE :INVITE <nick> <channel>");
499+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
500+ "INVITE :Invites a user to a channel.");
501+ return 0;
502+}
503+
504+
505+/*
506+ * mh_ison - help message handler
507+ * TODO: check that syntax is clear - no limit on number of nicks
508+ */
509+int mh_ison(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
510+{
511+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
512+ "ISON :ISON <nick> [<nick> [..]]");
513+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
514+ "ISON :Returns the nicks that are on the network.");
515+ return 0;
516+}
517+
518+
519+/*
520+ * mh_join - help message handler
521+ */
522+int mh_join(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
523+{
524+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
525+ "JOIN :JOIN <channel> [<key>]");
526+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
527+ "JOIN :Joins a channel, where <channel> and <key> are a comma separated list of one or more elements.");
528+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
529+ "JOIN :Joining channel 0 can be used to leave all channels.");
530+ return 0;
531+}
532+
533+
534+/*
535+ * mh_jupe - help message handler
536+ * TODO: check HIS?
537+ */
538+int mh_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
539+{
540+ if (!IsAnOper(sptr))
541+ return mh_not_oper(cptr, sptr, parc, parv);
542+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
543+ "JUPE :JUPE [[+|-]<server> [[<target>] <duration> :<reason>]]");
544+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
545+ "JUPE :Views or manipulates server jupes.");
546+ return 0;
547+}
548+
549+
550+/*
551+ * mh_kick - help message handler
552+ */
553+int mh_kick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
554+{
555+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
556+ "KICK :KICK <channel> <nick> [:<reason>]");
557+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
558+ "KICK :Kicks a user from a channel.");
559+ return 0;
560+}
561+
562+
563+/*
564+ * mh_kill - help message handler
565+ */
566+int mh_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
567+{
568+ if (!IsAnOper(sptr))
569+ return mh_not_oper(cptr, sptr, parc, parv);
570+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
571+ "KILL :KILL <nick> :<reason>");
572+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
573+ "KILL :Disconnects a user from the network.");
574+ return 0;
575+}
576+
577+
578+/*
579+ * mh_links - help message handler
580+ * TODO: check HIS feature
581+ */
582+int mh_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
583+{
584+ if (!IsAnOper(sptr))
585+ return mh_not_oper(cptr, sptr, parc, parv);
586+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
587+ "LINKS :LINKS [[<remote server>] <mask>]");
588+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
589+ "LINKS :Shows server links on the network.");
590+ return 0;
591+}
592+
593+
594+/*
595+ * mh_list - help message handler
596+ */
597+int mh_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
598+{
599+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
600+ "LIST :LIST :[<channel>|<parameters>|STOP]");
601+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
602+ "LIST :Lists channels on the network. See \"/QUOTE LIST :\" for more info.");
603+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
604+ "LIST :Parameter <channel> is a comma separated list of one or more channels.");
605+ return 0;
606+}
607+
608+
609+/*
610+ * mh_lusers - help message handler
611+ * TODO: check HIS remote feature
612+ */
613+int mh_lusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
614+{
615+ if (!IsAnOper(sptr))
616+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
617+ "LUSERS :LUSERS");
618+ else
619+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
620+ "LUSERS :LUSERS [<dummy> [<remote server>]]");
621+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
622+ "LUSERS :Shows information about the number of users on the network.");
623+ return 0;
624+}
625+
626+
627+/*
628+ * mh_map - help message handler
629+ * TODO: check HIS feature
630+ */
631+int mh_map(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
632+{
633+ if (!IsAnOper(sptr))
634+ return mh_not_oper(cptr, sptr, parc, parv);
635+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
636+ "MAP :MAP [<mask>]");
637+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
638+ "MAP :Shows a map of the servers on the network.");
639+ return 0;
640+}
641+
642+
643+/*
644+ * mh_mode - help message handler
645+ * TODO: check syntax is clear
646+ */
647+int mh_mode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
648+{
649+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
650+ "MODE :MODE <channel>|<nick> [<modes>]");
651+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
652+ "MODE :Views or changes modes of a channel or user.");
653+ return 0;
654+}
655+
656+
657+/*
658+ * mh_motd - help message handler
659+ * TODO: check HIS remote feature
660+ */
661+int mh_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
662+{
663+ if (!IsAnOper(sptr))
664+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
665+ "MOTD :MOTD");
666+ else
667+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
668+ "MOTD :MOTD [<server>]");
669+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
670+ "MOTD :Shows the Message Of The Day.");
671+ return 0;
672+}
673+
674+
675+/*
676+ * mh_names - help message handler
677+ * TODO: check HIS remote feature
678+ */
679+int mh_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
680+{
681+ if (!IsAnOper(sptr))
682+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
683+ "NAMES :NAMES [[-D] <channel>]");
684+ else
685+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
686+ "NAMES :NAMES [[[-D] [channel]] [<server>]]");
687+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
688+ "NAMES :Shows the names of users on the channel.");
689+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
690+ "NAMES :Parameter <channel> is a comma separated list of one or more channels,"
691+ " and the -D option is for listing delayedjoin users.");
692+ return 0;
693+}
694+
695+
696+/*
697+ * mh_nick - help message handler
698+ */
699+int mh_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
700+{
701+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
702+ "NICK :NICK <newnick>");
703+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
704+ "NICK :Changes nickname.");
705+ return 0;
706+}
707+
708+
709+/*
710+ * mh_notice - help message handler
711+ */
712+int mh_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
713+{
714+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
715+ "NOTICE :NOTICE <target> :<message>");
716+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
717+ "NOTICE :Sends a notice to a target, where <target> can be a comma separated list of one or more nicks or channels.");
718+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
719+ "NOTICE :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS).");
720+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
721+ "NOTICE :Parameter <target> can be in the form of <nick>@<server> to send to a service.");
722+ if (IsAnOper(sptr)) {
723+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
724+ "NOTICE :Parameter <target> can be a $<servername> to broadcast a message to all users on a server.");
725+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
726+ "NOTICE :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host.");
727+ }
728+ return 0;
729+}
730+
731+
732+/*
733+ * mh_oper - help message handler
734+ */
735+int mh_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
736+{
737+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
738+ "OPER :OPER <username> <password>");
739+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
740+ "OPER :Logs in as IRC Operator.");
741+ return 0;
742+}
743+
744+
745+/*
746+ * mh_opmode - help message handler
747+ */
748+int mh_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
749+{
750+ if (!IsAnOper(sptr))
751+ return mh_not_oper(cptr, sptr, parc, parv);
752+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
753+ "OPMODE :OPMODE [!]<channel> <modes>");
754+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
755+ "OPMODE :Changes modes on a channel.");
756+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
757+ "OPMODE :The ! prefix may be used to override a channel quarantine.");
758+ return 0;
759+}
760+
761+/*
762+ * mh_part - help message handler
763+ */
764+int mh_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
765+{
766+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
767+ "PART :PART <channel> [:<message>]");
768+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
769+ "PART :Parts a channel with an optional message.");
770+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
771+ "PART :Parameter <channel> is a comma separated list of one or more channels.");
772+ return 0;
773+}
774+
775+
776+/*
777+ * mh_pass - help message handler
778+ */
779+int mh_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
780+{
781+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
782+ "PASS :PASS :<password>");
783+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
784+ "PASS :Provides the password required to connect to the server.");
785+ return 0;
786+}
787+
788+
789+/*
790+ * mh_ping - help message handler
791+ * TODO: <text> ?
792+ */
793+int mh_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
794+{
795+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
796+ "PING :PING :<text>");
797+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
798+ "PING :Sends a ping to the server.");
799+ return 0;
800+}
801+
802+
803+/*
804+ * mh_pong - help message handler
805+ * TODO: <text> ?
806+ */
807+int mh_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
808+{
809+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
810+ "PONG :PONG :<text>");
811+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
812+ "PONG :Sends a pong as reply to a PING from the server.");
813+ return 0;
814+}
815+
816+
817+/*
818+ * mh_privmsg - help message handler
819+ */
820+int mh_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
821+{
822+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
823+ "PRIVMSG :PRIVMSG <target> :<message>");
824+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
825+ "PRIVMSG :Sends a message to a target, where <target> can be a comma separated list of one or more nicks or channels.");
826+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
827+ "PRIVMSG :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS).");
828+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
829+ "PRIVMSG :Parameter <target> can be in the form of <nick>@<server> to send to a service.");
830+ if (IsAnOper(sptr)) {
831+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
832+ "PRIVMSG :Parameter <target> can be a $<servername> to broadcast a message to all users on a server.");
833+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
834+ "PRIVMSG :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host.");
835+ }
836+ return 0;
837+}
838+
839+
840+/*
841+ * mh_privs - help message handler
842+ */
843+int mh_privs(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
844+{
845+ if (!IsAnOper(sptr))
846+ return mh_not_oper(cptr, sptr, parc, parv);
847+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
848+ "PRIVS :PRIVS <nick> [<nick> [..]]");
849+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
850+ "PRIVS :Shows the privileges an IRC Operator has.");
a87bc2c2 851+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
852+ "PRIVS :CHAN_LIMIT oper has no channel limit (JOIN)");
853+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
854+ "PRIVS :MODE_LCHAN oper can mode local chans without channel operator status");
855+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
856+ "PRIVS :WALK_LCHAN oper can walk through local modes (JOIN &chan override)");
857+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
858+ "PRIVS :DEOP_LCHAN oper cannot be deoped on local chans");
859+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
860+ "PRIVS :SHOW_INVIS show local invisible users");
861+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
862+ "PRIVS :SHOW_ALL_INVIS show all invisible users");
863+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
864+ "PRIVS :UNLIMIT_QUERY unlimited results in WHO");
865+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
866+ "PRIVS :KILL oper can KILL");
867+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
868+ "PRIVS :LOCAL_KILL oper can local KILL");
869+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
870+ "PRIVS :REHASH oper can REHASH");
871+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
872+ "PRIVS :RESTART oper can RESTART");
873+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
874+ "PRIVS :DIE oper can DIE");
875+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
876+ "PRIVS :GLINE oper can GLINE");
877+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
878+ "PRIVS :LOCAL_GLINE oper can local GLINE");
879+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
880+ "PRIVS :JUPE oper can JUPE");
881+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
882+ "PRIVS :LOCAL_JUPE oper can local JUPE");
883+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
884+ "PRIVS :OPMODE oper can OPMODE and CLEARMODE");
885+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
886+ "PRIVS :LOCAL_OPMODE oper can local OPMODE and CLEARMODE");
887+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
888+ "PRIVS :SET oper can SET");
889+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
890+ "PRIVS :WHOX log oper's usage of WHO x");
891+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
892+ "PRIVS :BADCHAN oper can BADCHAN (GLINE)");
893+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
894+ "PRIVS :LOCAL_BADCHAN oper can local BADCHAN (GLINE)");
895+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
896+ "PRIVS :SEE_CHAN oper can see in secret chans");
897+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
898+ "PRIVS :PROPAGATE propagate oper status");
899+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
900+ "PRIVS :DISPLAY oper status is displayed");
901+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
902+ "PRIVS :SEE_OPERS oper can see hidden opers");
903+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
904+ "PRIVS :WIDE_GLINE oper can set wider GLINE");
905+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
906+ "PRIVS :LIST_CHAN oper can LIST secret channels");
907+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
908+ "PRIVS :FORCE_OPMODE can hack modes on quarantined channels");
909+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
910+ "PRIVS :FORCE_LOCAL_OPMODE can hack modes on quarantined local channels");
911+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
912+ "PRIVS :APASS_OPMODE can hack modes +A/-A/+U/-U");
913+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
914+ "PRIVS :CHANSERV oper can set usermode +k");
915+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
916+ "PRIVS :XTRA_OPER oper can set usermode +X");
917+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
918+ "PRIVS :NOIDLE oper can set usermode +I");
919+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
920+ "PRIVS :FREEFORM oper can use freeform SETHOST");
921+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
922+ "PRIVS :PARANOID oper can set usermode +P");
923+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
924+ "PRIVS :CHECK oper can use CHECK");
925+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
926+ "PRIVS :WALL oper can use WALLOPS and WALLUSERS");
927+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
928+ "PRIVS :CLOSE oper can use CLOSE");
929+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
930+ "PRIVS :ROUTE oper can use CONNECT and SQUIT");
931+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
932+ "PRIVS :ROUTEINFO oper can use MAP, TRACE, ASLL, LINKS, and view JUPE list");
933+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
934+ "PRIVS :USER_PRIVACY oper can bypass user privacy (see through usermode +x)");
935+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
936+ "PRIVS :CHANNEL_PRIVACY oper can bypass channel privacy (see info on channels they are not on)");
937+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
938+ "PRIVS :SERVERINFO oper can use GET, STATS, HASH, and retrieve remote information");
cddf800b 939+ return 0;
940+}
941+
942+
943+/*
944+ * mh_quit - help message handler
945+ * TODO: Disconnect or Disconnects?
946+ */
947+int mh_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
948+{
949+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
950+ "QUIT :QUIT :<message>");
951+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
952+ "QUIT :Disconnect from the network with an optional message.");
953+ return 0;
954+}
955+
956+
957+/*
958+ * mh_rehash - help message handler
959+ * TODO: check the options, etc.
960+ */
961+int mh_rehash(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
962+{
963+ if (!IsAnOper(sptr))
964+ return mh_not_oper(cptr, sptr, parc, parv);
965+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
966+ "REHASH :REHASH [L|M|Q]");
967+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
968+ "REHASH :Reloads the server conf file, MOTD, and log files.");
969+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
970+ "REHASH :Where L reopens the log files, M flushes the MOTD cache, Q the DNS resolver is not restarted.");
971+ return 0;
972+}
973+
974+
975+/*
976+ * mh_reset - help message handler
977+ */
978+int mh_reset(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
979+{
980+ if (!IsAnOper(sptr))
981+ return mh_not_oper(cptr, sptr, parc, parv);
982+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
983+ "RESET :RESET <feature> [<parameters>]");
984+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
985+ "RESET :Resets a feature to its default hardcoded value.");
986+ return 0;
987+}
988+
989+
990+/*
991+ * mh_restart - help message handler
992+ */
993+int mh_restart(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
994+{
995+ if (!IsAnOper(sptr))
996+ return mh_not_oper(cptr, sptr, parc, parv);
997+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
998+ "RESTART :RESTART <server>");
999+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1000+ "RESTART :Restarts the server. The servername needs to be given as sanity check.");
1001+ return 0;
1002+}
1003+
1004+
1005+/*
1006+ * mh_rping - help message handler
1007+ * TODO: <text> ?
1008+ */
1009+int mh_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1010+{
1011+ if (!IsAnOper(sptr))
1012+ return mh_not_oper(cptr, sptr, parc, parv);
1013+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1014+ "RPING :RPING <server> [<remote server>] [:<text>]");
1015+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1016+ "RPING :Pings a remote server and returns the Round Trip Time in milliseconds.");
1017+ return 0;
1018+}
1019+
1020+
1021+/*
1022+ * mh_set - help message handler
1023+ */
1024+int mh_set(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1025+{
1026+ if (!IsAnOper(sptr))
1027+ return mh_not_oper(cptr, sptr, parc, parv);
1028+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1029+ "SET :SET <feature> [<parameters>] :<value>");
1030+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1031+ "SET :Changes the value of a feature.");
1032+ return 0;
1033+}
1034+
1035+
1036+/*
1037+ * mh_sethost - help message handler
1038+ */
1039+int mh_sethost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1040+{
1041+ if (!IsAnOper(sptr)) {
1042+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1043+ "SETHOST :SETHOST <spoofhost> <password>");
1044+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1045+ "SETHOST :Sets a spoof host.");
1046+ } else {
1047+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1048+ "SETHOST :SETHOST <user> <host>");
1049+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1050+ "SETHOST :Sets a spoof user@host.");
1051+ }
1052+ return 0;
1053+}
1054+
1055+
1056+/*
1057+ * mh_settime - help message handler
1058+ */
1059+int mh_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1060+{
1061+ if (!IsAnOper(sptr))
1062+ return mh_not_oper(cptr, sptr, parc, parv);
1063+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1064+ "SETTIME :SETTIME <timestamp> [<server>]");
1065+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1066+ "SETTIME :Changes the time on a server."
1067+ "When parameter <timestamp> is 0 the local server "
1068+ "uses its own timestamp before sending it to the remote server.");
1069+ return 0;
1070+}
1071+
1072+
1073+/*
1074+ * mh_silence - help message handler
1075+ * TODO: mention ~ exempt mask prefix
1076+ */
1077+int mh_silence(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1078+{
1079+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1080+ "SILENCE :SILENCE [[+|-]<mask>|<nick>]");
1081+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1082+ "SILENCE :Views or changes the silence list.");
1083+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1084+ "SILENCE :Parameter <mask> is a comma separated list of one or more masks.");
1085+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1086+ "SILENCE :Silence is a server side ignore -"
1087+ " any message sent privately or invites from a user matching a silence mask is dropped.");
1088+ return 0;
1089+}
1090+
1091+
1092+/*
1093+ * mh_squit - help message handler
1094+ */
1095+int mh_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1096+{
1097+ if (!IsAnOper(sptr))
1098+ return mh_not_oper(cptr, sptr, parc, parv);
1099+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1100+ "SQUIT :SQUIT <server> [:<reason>]");
1101+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1102+ "SQUIT :Disconnects a server from the network.");
1103+ return 0;
1104+}
1105+
1106+
1107+/*
1108+ * mh_stats - help message handler
1109+ * TODO: check HIS (too many per stats type) / HIS remote?
1110+ */
1111+int mh_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1112+{
1113+ if (!IsAnOper(sptr))
1114+ return mh_not_oper(cptr, sptr, parc, parv);
1115+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1116+ "STATS :STATS [<type> [[<server>] [<mask>]]]");
1117+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1118+ "STATS :Shows server configuration and statistics.");
1119+ return 0;
1120+}
1121+
1122+
1123+/*
1124+ * mh_time - help message handler
1125+ * TODO: check HIS remote feature
1126+ */
1127+int mh_time(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1128+{
1129+ if (!IsAnOper(sptr)) {
1130+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1131+ "TIME :TIME");
1132+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1133+ "TIME :Shows the time on the server.");
1134+ }
1135+ else {
1136+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1137+ "TIME :TIME [<server>]");
1138+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1139+ "TIME :Shows the time on the server.");
1140+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1141+ "TIME :Parameter <server> can be a * to view the time from all servers.");
1142+ }
1143+
1144+ return 0;
1145+}
1146+
1147+
1148+/*
1149+ * mh_topic - help message handler
1150+ */
1151+int mh_topic(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1152+{
1153+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1154+ "TOPIC :TOPIC <channel> [:<text>]");
1155+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1156+ "TOPIC :Views or changes the topic on a channel.");
1157+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1158+ "TOPIC :Parameter <channel> is a comma separated list of one or more channels.");
1159+ return 0;
1160+}
1161+
1162+
1163+/*
1164+ * mh_trace - help message handler
1165+ * TODO: check HIS / HIS remote?
1166+ * TODO: check <to server> parameter
1167+ */
1168+int mh_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1169+{
1170+ if (!IsAnOper(sptr))
1171+ return mh_not_oper(cptr, sptr, parc, parv);
1172+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1173+ "TRACE :TRACE [<nick>|<server> <to server>]");
1174+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1175+ "TRACE :Shows the route to a user or server.");
1176+ return 0;
1177+}
1178+
1179+
1180+/*
1181+ * mh_uping - help message handler
1182+ * TODO: default port 7007, define UDP_PORT
1183+ */
1184+int mh_uping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1185+{
1186+ if (!IsAnOper(sptr))
1187+ return mh_not_oper(cptr, sptr, parc, parv);
1188+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1189+ "UPING :UPING <server> [<port>] [<remote server>] [<number of packets>]");
1190+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1191+ "UPING :Pings the host of the server with UDP packets - server does not have to be linked.");
1192+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1193+ "UPING :By default port 7007 is used, and 5 packets are sent (maximum is 20).");
1194+ return 0;
1195+}
1196+
1197+
1198+/*
1199+ * mh_user - help message handler
1200+ */
1201+int mh_user(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1202+{
1203+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1204+ "USER :USER <username> <hostname> <servername> :<realname>");
1205+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1206+ "USER :Registers a new client connection. Parameters <hostname> and <servername> are ignored.");
1207+ return 0;
1208+}
1209+
1210+
1211+/*
1212+ * mh_userhost - help message handler
1213+ * TODO: syntax clear?
1214+ * TODO: max 5
1215+ */
1216+int mh_userhost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1217+{
1218+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1219+ "USERHOST :USERHOST <nick> [<nick> [..]]");
1220+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1221+ "USERHOST :Returns the user@host for a user.");
1222+ return 0;
1223+}
1224+
1225+
1226+/*
1227+ * mh_userip - help message handler
1228+ * TODO: syntax clear?
1229+ * TODO: max 5
1230+ */
1231+int mh_userip(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1232+{
1233+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1234+ "USERIP :USERIP <nick> [<nick> [..]]");
1235+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1236+ "USERIP :Returns the user@ip for a user.");
1237+ return 0;
1238+}
1239+
1240+
1241+/*
1242+ * mh_version - help message handler
1243+ * TODO: check HIS remote feature
1244+ */
1245+int mh_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1246+{
1247+ if (!IsAnOper(sptr)) {
1248+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1249+ "VERSION :VERSION");
1250+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1251+ "VERSION :Shows information about the server, and the supported features and settings.");
1252+ }
1253+ else {
1254+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1255+ "VERSION :VERSION [<server>]");
1256+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1257+ "VERSION :Shows information about the server, and the supported features and settings.");
1258+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1259+ "VERSION :Parameter <server> can be a * to view the version info from all servers.");
1260+ }
1261+ return 0;
1262+}
1263+
1264+
1265+/*
1266+ * mh_wallchops - help message handler
1267+ * TODO: mention NOTICE @#channel?
1268+ */
1269+int mh_wallchops(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1270+{
1271+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1272+ "WALLCHOPS :WALLCHOPS <channel> :<message>");
1273+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1274+ "WALLCHOPS :Sends a channel notice to the operators on a channel.");
1275+ return 0;
1276+}
1277+
1278+
1279+/*
1280+ * mh_wallops - help message handler
1281+ * TODO: check HIS ?
1282+ */
1283+int mh_wallops(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1284+{
1285+ if (!IsAnOper(sptr))
1286+ return mh_not_oper(cptr, sptr, parc, parv);
1287+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1288+ "WALLOPS :WALLOPS :<message>");
1289+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1290+ "WALLOPS :Sends a message to all IRC Operators with usermode +w set.");
1291+ return 0;
1292+}
1293+
1294+
1295+/*
1296+ * mh_wallusers - help message handler
1297+ */
1298+int mh_wallusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1299+{
1300+ if (!IsAnOper(sptr))
1301+ return mh_not_oper(cptr, sptr, parc, parv);
1302+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1303+ "WALLUSERS :WALLUSERS :<message>");
1304+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1305+ "WALLUSERS :Sends a message to all users with usermode +w set.");
1306+ return 0;
1307+}
1308+
1309+
1310+/*
1311+ * mh_wallvoices - help message handler
1312+ */
1313+int mh_wallvoices(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1314+{
1315+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1316+ "WALLVOICES :WALLVOICES <channel> :<message>");
1317+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1318+ "WALLVOICES :Sends a channel notice to the voices and operators on a channel.");
1319+ return 0;
1320+}
1321+
1322+
1323+/*
1324+ * mh_who - help message handler
1325+ * TODO: this is all way too much to add here.. :(
1326+ * TODO: mention <mask> - chan, nick, user, host, ip, server, realname
1327+ * TODO: filter
1328+d Join-delayed channel members
1329+o IRC Operator (specifying this one means only opers are matched)
1330+
1331+ * TODO: x for operators
1332+
1333+ * TODO: match
1334+n Nick, u Username, h Hostname, i Numeric IP,
1335+s Servername, r Realname, a Account name
1336+
1337+
1338+ * TODO: return
1339+t Include the querytype in the reply
1340+c Include (first) channel name (* when none can be shown)
1341+u Include userID with eventual ~
1342+i Include IP
1343+h Include hostname
1344+s Include server name
1345+n Include nick
1346+f Include flags
1347+d Include "distance" in hops
1348+l Include idle time (0 for remote users)
1349+a Include account name (0 when the user has no account set)
1350+o Include oplevel
1351+r Include real name
1352+b Include account ID
1353+
1354+ * TODO: HIS settings
1355+ */
1356+int mh_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1357+{
1358+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1359+ "WHO :WHO <mask> [[<match>][%<fields>[,<querytype>]] [:<mask>]]");
1360+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1361+ "WHO :Returns information on a user.");
1362+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1363+ "WHO :Parameter <mask> can be a comma separated list of one or more nicks and channels.");
1364+ return 0;
1365+}
1366+
1367+
1368+/*
1369+ * mh_whois - help message handler
1370+ * TODO: check HIS / HIS remote
1371+ */
1372+int mh_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1373+{
1374+ if (!IsAnOper(sptr)) {
1375+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1376+ "WHOIS :WHOIS [<dummy>] <nick>");
1377+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1378+ "WHOIS :Shows who someone is.");
1379+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1380+ "WHOIS :Parameter <nick> is a comma separated list of one or more nicks,"
1381+ " <dummy> can be specified to get a reply from the user's server to show idle and signon time");
1382+ }
1383+ else {
1384+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1385+ "WHOIS :WHOIS [<server>] <nick>");
1386+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1387+ "WHOIS :Shows who someone is.");
1388+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1389+ "WHOIS :Parameter <nick> is a comma separated list of one or more nicks,"
1390+ " the same nick can be specified as <server> to get a reply from the user's server to show idle and signon time");
1391+ }
1392+ return 0;
1393+}
1394+
1395+
1396+/*
1397+ * mh_whowas - help message handler
1398+ * TODO: check HIS / HIS remote
1399+ * TODO: see if 20 is a define
1400+ */
1401+int mh_whowas(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1402+{
1403+ if (!IsAnOper(sptr)) {
1404+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1405+ "WHOWAS :WHOWAS <nick> [<max>]");
1406+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1407+ "WHOWAS :Shows who someone was.");
1408+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1409+ "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks,"
1410+ " <max> is 0 by default (unlimited).");
1411+ }
1412+ else {
1413+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1414+ "WHOWAS :WHOIS <nick> [<max> [<server>]]");
1415+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1416+ "WHOWAS :Shows who someone was.");
1417+ send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1418+ "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks,"
1419+ " <max> is 0 by default (unlimited),"
1420+ " maximum number of results from a remote server is 20.");
1421+ }
1422+ return 0;
1423+}
efbd1f63 1424diff -r 5a1e5e09c766 ircd/parse.c
1425--- a/ircd/parse.c Sat Jan 31 18:46:47 2009 +0100
1426+++ b/ircd/parse.c Sat Jan 31 18:51:08 2009 +0100
cddf800b 1427@@ -110,534 +110,534 @@
12e82c05 1428 MSG_PRIVATE,
cddf800b 1429 TOK_PRIVATE,
1430 0, MAXPARA, MFLG_SLOW, 0, NULL,
1431- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1432- { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore }
1433+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1434+ { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore, mh_privmsg }
1435 },
1436 {
1437 MSG_NICK,
1438 TOK_NICK,
1439 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1440- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1441- { m_nick, m_nick, ms_nick, m_nick, m_ignore }
1442+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1443+ { m_nick, m_nick, ms_nick, m_nick, m_ignore, mh_nick }
1444 },
1445 {
1446 MSG_NOTICE,
1447 TOK_NOTICE,
1448 0, MAXPARA, MFLG_SLOW | MFLG_IGNORE, 0, NULL,
1449- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1450- { m_ignore, m_notice, ms_notice, mo_notice, m_ignore }
1451+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1452+ { m_ignore, m_notice, ms_notice, mo_notice, m_ignore, mh_notice }
1453 },
1454 {
1455 MSG_WALLCHOPS,
1456 TOK_WALLCHOPS,
1457 0, MAXPARA, MFLG_SLOW, 0, NULL,
1458- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1459- { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore }
1460+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1461+ { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore, mh_wallchops }
1462 },
1463 {
1464 MSG_WALLVOICES,
1465 TOK_WALLVOICES,
1466 0, MAXPARA, MFLG_SLOW, 0, NULL,
1467- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1468- { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore }
1469+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1470+ { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore, mh_wallvoices }
1471 },
1472 {
1473 MSG_CPRIVMSG,
1474 TOK_CPRIVMSG,
1475 0, MAXPARA, MFLG_SLOW, 0, NULL,
1476- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1477- { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore }
1478+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1479+ { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore, mh_cprivmsg }
1480 },
1481 {
1482 MSG_CNOTICE,
1483 TOK_CNOTICE,
1484 0, MAXPARA, MFLG_SLOW, 0, NULL,
1485- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1486- { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore }
1487+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1488+ { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore, mh_cnotice }
1489 },
1490 {
1491 MSG_JOIN,
1492 TOK_JOIN,
1493 0, MAXPARA, MFLG_SLOW, 0, NULL,
1494- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1495- { m_unregistered, m_join, ms_join, m_join, m_ignore }
1496+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1497+ { m_unregistered, m_join, ms_join, m_join, m_ignore, mh_join }
1498 },
1499 {
1500 MSG_MODE,
1501 TOK_MODE,
1502 0, MAXPARA, MFLG_SLOW, 0, NULL,
1503- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1504- { m_unregistered, m_mode, ms_mode, m_mode, m_ignore }
1505+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1506+ { m_unregistered, m_mode, ms_mode, m_mode, m_ignore, mh_mode }
1507 },
1508 {
1509 MSG_BURST,
1510 TOK_BURST,
1511 0, MAXPARA, MFLG_SLOW, 0, NULL,
1512- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1513- { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore }
1514+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1515+ { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore, mh_not_server }
1516 },
1517 {
1518 MSG_CREATE,
1519 TOK_CREATE,
1520 0, MAXPARA, MFLG_SLOW, 0, NULL,
1521- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1522- { m_ignore, m_ignore, ms_create, m_ignore, m_ignore }
1523+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1524+ { m_ignore, m_ignore, ms_create, m_ignore, m_ignore, mh_not_server }
1525 },
1526 {
1527 MSG_DESTRUCT,
1528 TOK_DESTRUCT,
1529 0, MAXPARA, MFLG_SLOW, 0, NULL,
1530- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1531- { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore }
1532+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1533+ { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore, mh_not_server }
1534 },
1535 {
1536 MSG_QUIT,
1537 TOK_QUIT,
1538 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1539- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1540- { m_quit, m_quit, ms_quit, m_quit, m_ignore }
1541+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1542+ { m_quit, m_quit, ms_quit, m_quit, m_ignore, mh_quit }
1543 },
1544 {
1545 MSG_PART,
1546 TOK_PART,
1547 0, MAXPARA, MFLG_SLOW, 0, NULL,
1548- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1549- { m_unregistered, m_part, ms_part, m_part, m_ignore }
1550+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1551+ { m_unregistered, m_part, ms_part, m_part, m_ignore, mh_part }
1552 },
1553 {
1554 MSG_TOPIC,
1555 TOK_TOPIC,
1556 0, MAXPARA, MFLG_SLOW, 0, NULL,
1557- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1558- { m_unregistered, m_topic, ms_topic, m_topic, m_ignore }
1559+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1560+ { m_unregistered, m_topic, ms_topic, m_topic, m_ignore, mh_topic }
1561 },
1562 {
1563 MSG_INVITE,
1564 TOK_INVITE,
1565 0, MAXPARA, MFLG_SLOW, 0, NULL,
1566- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1567- { m_unregistered, m_invite, ms_invite, m_invite, m_ignore }
1568+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1569+ { m_unregistered, m_invite, ms_invite, m_invite, m_ignore, mh_invite }
1570 },
1571 {
1572 MSG_KICK,
1573 TOK_KICK,
1574 0, MAXPARA, MFLG_SLOW, 0, NULL,
1575- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1576- { m_unregistered, m_kick, ms_kick, m_kick, m_ignore }
1577+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1578+ { m_unregistered, m_kick, ms_kick, m_kick, m_ignore, mh_kick }
1579 },
1580 {
1581 MSG_WALLOPS,
1582 TOK_WALLOPS,
1583 0, MAXPARA, MFLG_SLOW, 0, NULL,
1584- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1585- { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore }
1586+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1587+ { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore, mh_wallops }
1588 },
1589 {
1590 MSG_WALLUSERS,
1591 TOK_WALLUSERS,
1592 0, MAXPARA, MFLG_SLOW, 0, NULL,
1593- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1594- { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore }
1595+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1596+ { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore, mh_wallusers }
1597 },
1598 {
1599 MSG_DESYNCH,
1600 TOK_DESYNCH,
1601 0, MAXPARA, MFLG_SLOW, 0, NULL,
1602- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1603- { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore }
1604+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1605+ { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore, mh_not_server }
1606 },
1607 {
1608 MSG_PING,
1609 TOK_PING,
1610 0, MAXPARA, MFLG_SLOW, 0, NULL,
1611- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1612- { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore }
1613+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1614+ { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore, mh_ping }
1615 },
1616 {
1617 MSG_PONG,
1618 TOK_PONG,
1619 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1620- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1621- { mr_pong, m_pong, ms_pong, m_pong, m_ignore }
1622+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1623+ { mr_pong, m_pong, ms_pong, m_pong, m_ignore, mh_pong }
1624 },
1625 {
1626 MSG_ERROR,
1627 TOK_ERROR,
1628 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1629- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1630- { mr_error, m_ignore, ms_error, m_ignore, m_ignore }
1631+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1632+ { mr_error, m_ignore, ms_error, m_ignore, m_ignore, mh_not_server }
1633 },
1634 {
1635 MSG_KILL,
1636 TOK_KILL,
1637 0, MAXPARA, MFLG_SLOW, 0, NULL,
1638- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1639- { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore }
1640+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1641+ { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore, mh_kill }
1642 },
1643 {
1644 MSG_USER,
1645 TOK_USER,
1646 0, MAXPARA, MFLG_SLOW, 0, NULL,
1647- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1648- { m_user, m_registered, m_ignore, m_registered, m_ignore }
1649+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1650+ { m_user, m_registered, m_ignore, m_registered, m_ignore, mh_user }
1651 },
1652 {
1653 MSG_AWAY,
1654 TOK_AWAY,
1655 0, MAXPARA, MFLG_SLOW, 0, NULL,
1656- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1657- { m_unregistered, m_away, ms_away, m_away, m_ignore }
1658+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1659+ { m_unregistered, m_away, ms_away, m_away, m_ignore, mh_away }
1660 },
1661 {
1662 MSG_ISON,
1663 TOK_ISON,
1664 0, 1, MFLG_SLOW, 0, NULL,
1665- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1666- { m_unregistered, m_ison, m_ignore, m_ison, m_ignore }
1667+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1668+ { m_unregistered, m_ison, m_ignore, m_ison, m_ignore, mh_ison }
1669 },
1670 {
1671 MSG_SERVER,
1672 TOK_SERVER,
1673 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1674- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1675- { mr_server, m_registered, ms_server, m_registered, m_ignore }
1676+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1677+ { mr_server, m_registered, ms_server, m_registered, m_ignore, mh_not_server }
1678 },
1679 {
1680 MSG_SQUIT,
1681 TOK_SQUIT,
1682 0, MAXPARA, MFLG_SLOW, 0, NULL,
1683- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1684- { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore }
1685+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1686+ { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore, mh_squit }
1687 },
1688 {
1689 MSG_WHOIS,
1690 TOK_WHOIS,
1691 0, MAXPARA, MFLG_SLOW, 0, NULL,
1692- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1693- { m_unregistered, m_whois, ms_whois, m_whois, m_ignore }
1694+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1695+ { m_unregistered, m_whois, ms_whois, m_whois, m_ignore, mh_whois }
1696 },
1697 {
1698 MSG_WHO,
1699 TOK_WHO,
1700 0, MAXPARA, MFLG_SLOW, 0, NULL,
1701- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1702- { m_unregistered, m_who, m_ignore, m_who, m_ignore }
1703+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1704+ { m_unregistered, m_who, m_ignore, m_who, m_ignore, mh_who }
1705 },
1706 {
1707 MSG_WHOWAS,
1708 TOK_WHOWAS,
1709 0, MAXPARA, MFLG_SLOW, 0, NULL,
1710- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1711- { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore }
1712+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1713+ { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore, mh_whowas }
1714 },
1715 {
1716 MSG_LIST,
1717 TOK_LIST,
1718 0, MAXPARA, MFLG_SLOW, 0, NULL,
1719- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1720- { m_unregistered, m_list, m_ignore, m_list, m_ignore }
1721+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1722+ { m_unregistered, m_list, m_ignore, m_list, m_ignore, mh_list }
1723 },
1724 {
1725 MSG_NAMES,
1726 TOK_NAMES,
1727 0, MAXPARA, MFLG_SLOW, 0, NULL,
1728- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1729- { m_unregistered, m_names, m_names, m_names, m_ignore }
1730+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1731+ { m_unregistered, m_names, m_names, m_names, m_ignore, mh_names }
1732 },
1733 {
1734 MSG_USERHOST,
1735 TOK_USERHOST,
1736 0, 1, MFLG_SLOW, 0, NULL,
1737- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1738- { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore }
1739+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1740+ { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore, mh_userhost }
1741 },
1742 {
1743 MSG_USERIP,
1744 TOK_USERIP,
1745 0, 1, MFLG_SLOW, 0, NULL,
1746- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1747- { m_unregistered, m_userip, m_ignore, m_userip, m_ignore }
1748+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1749+ { m_unregistered, m_userip, m_ignore, m_userip, m_ignore, mh_userip }
1750 },
1751 {
1752 MSG_TRACE,
1753 TOK_TRACE,
1754 0, MAXPARA, MFLG_SLOW, 0, NULL,
1755- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1756- { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore }
1757+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1758+ { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore, mh_trace }
1759 },
1760 {
1761 MSG_PASS,
1762 TOK_PASS,
1763 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1764- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1765- { mr_pass, m_registered, m_ignore, m_registered, m_ignore }
1766+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1767+ { mr_pass, m_registered, m_ignore, m_registered, m_ignore, mh_pass }
1768 },
1769 {
1770 MSG_LUSERS,
1771 TOK_LUSERS,
1772 0, MAXPARA, MFLG_SLOW, 0, NULL,
1773- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1774- { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore }
1775+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1776+ { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore, mh_lusers }
1777 },
1778 {
1779 MSG_TIME,
1780 TOK_TIME,
1781 0, MAXPARA, MFLG_SLOW, 0, NULL,
1782- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1783- { m_unregistered, m_time, m_time, m_time, m_ignore }
1784+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1785+ { m_unregistered, m_time, m_time, m_time, m_ignore, mh_time }
1786 },
1787 {
1788 MSG_SETTIME,
1789 TOK_SETTIME,
1790 0, MAXPARA, MFLG_SLOW, 0, NULL,
1791- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1792- { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore }
1793+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1794+ { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore, mh_settime }
1795 },
1796 {
1797 MSG_RPING,
1798 TOK_RPING,
1799 0, MAXPARA, MFLG_SLOW, 0, NULL,
1800- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1801- { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore }
1802+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1803+ { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore, mh_rping }
1804 },
1805 {
1806 MSG_RPONG,
1807 TOK_RPONG,
1808 0, MAXPARA, MFLG_SLOW, 0, NULL,
1809- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1810- { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore }
1811+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1812+ { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore, mh_not_server }
1813 },
1814 {
1815 MSG_OPER,
1816 TOK_OPER,
1817 0, MAXPARA, MFLG_SLOW, 0, NULL,
1818- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1819- { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore }
1820+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1821+ { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore, mh_oper }
1822 },
1823 {
1824 MSG_CONNECT,
1825 TOK_CONNECT,
1826 0, MAXPARA, MFLG_SLOW, 0, NULL,
1827- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1828- { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore }
1829+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1830+ { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore, mh_connect }
1831 },
1832 {
1833 MSG_MAP,
1834 TOK_MAP,
1835 0, MAXPARA, MFLG_SLOW, 0, NULL,
1836- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1837- { m_unregistered, m_map, m_ignore, m_map, m_ignore }
1838+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1839+ { m_unregistered, m_map, m_ignore, m_map, m_ignore, mh_map }
1840 },
1841 {
1842 MSG_VERSION,
1843 TOK_VERSION,
1844 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1845- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1846- { m_version, m_version, ms_version, mo_version, m_ignore }
1847+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1848+ { m_version, m_version, ms_version, mo_version, m_ignore, mh_version }
1849 },
1850 {
1851 MSG_STATS,
1852 TOK_STATS,
1853 0, MAXPARA, MFLG_SLOW, 0, NULL,
1854- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1855- { m_unregistered, m_stats, m_stats, m_stats, m_ignore }
1856+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1857+ { m_unregistered, m_stats, m_stats, m_stats, m_ignore, mh_stats }
1858 },
1859 {
1860 MSG_LINKS,
1861 TOK_LINKS,
1862 0, MAXPARA, MFLG_SLOW, 0, NULL,
1863- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1864- { m_unregistered, m_links, ms_links, m_links, m_ignore }
1865+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1866+ { m_unregistered, m_links, ms_links, m_links, m_ignore, mh_links }
1867 },
1868 {
1869 MSG_ADMIN,
1870 TOK_ADMIN,
1871 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1872- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1873- { m_admin, m_admin, ms_admin, mo_admin, m_ignore }
1874+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1875+ { m_admin, m_admin, ms_admin, mo_admin, m_ignore, mh_admin }
1876 },
1877 {
1878 MSG_HELP,
1879 TOK_HELP,
1880 0, MAXPARA, MFLG_SLOW, 0, NULL,
1881- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1882- { m_unregistered, m_help, m_ignore, m_help, m_ignore }
1883+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1884+ { m_unregistered, m_help, m_ignore, m_help, m_ignore, mh_help }
1885 },
1886 {
1887 MSG_INFO,
1888 TOK_INFO,
1889 0, MAXPARA, MFLG_SLOW, 0, NULL,
1890- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1891- { m_unregistered, m_info, ms_info, mo_info, m_ignore }
1892+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1893+ { m_unregistered, m_info, ms_info, mo_info, m_ignore, mh_info }
1894 },
1895 {
1896 MSG_MOTD,
1897 TOK_MOTD,
1898 0, MAXPARA, MFLG_SLOW, 0, NULL,
1899- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1900- { m_unregistered, m_motd, m_motd, m_motd, m_ignore }
1901+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1902+ { m_unregistered, m_motd, m_motd, m_motd, m_ignore, mh_motd }
1903 },
1904 {
1905 MSG_CLOSE,
1906 TOK_CLOSE,
1907 0, MAXPARA, MFLG_SLOW, 0, NULL,
1908- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1909- { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore }
1910+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1911+ { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore, mh_close }
1912 },
1913 {
1914 MSG_SILENCE,
1915 TOK_SILENCE,
1916 0, MAXPARA, MFLG_SLOW, 0, NULL,
1917- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1918- { m_unregistered, m_silence, ms_silence, m_silence, m_ignore }
1919+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1920+ { m_unregistered, m_silence, ms_silence, m_silence, m_ignore, mh_silence }
1921 },
1922 {
1923 MSG_GLINE,
1924 TOK_GLINE,
1925 0, MAXPARA, 0, 0, NULL,
1926- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1927- { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore }
1928+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1929+ { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore, mh_gline }
1930 },
1931 {
1932 MSG_JUPE,
1933 TOK_JUPE,
1934 0, MAXPARA, MFLG_SLOW, 0, NULL,
1935- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1936- { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore }
1937+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1938+ { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore, mh_jupe }
1939 },
1940 {
1941 MSG_OPMODE,
1942 TOK_OPMODE,
1943 0, MAXPARA, MFLG_SLOW, 0, NULL,
1944- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1945- { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore }
1946+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1947+ { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore, mh_opmode }
1948 },
1949 {
1950 MSG_CLEARMODE,
1951 TOK_CLEARMODE,
1952 0, MAXPARA, MFLG_SLOW, 0, NULL,
1953- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1954- { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore }
1955+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1956+ { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore, mh_clearmode }
1957 },
1958 {
1959 MSG_UPING,
1960 TOK_UPING,
1961 0, MAXPARA, MFLG_SLOW, 0, NULL,
1962- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1963- { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore }
1964+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1965+ { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore, mh_uping }
1966 },
1967 {
1968 MSG_END_OF_BURST,
1969 TOK_END_OF_BURST,
1970 0, MAXPARA, MFLG_SLOW, 0, NULL,
1971- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1972- { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore }
1973+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1974+ { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore, mh_not_server }
1975 },
1976 {
1977 MSG_END_OF_BURST_ACK,
1978 TOK_END_OF_BURST_ACK,
1979 0, MAXPARA, MFLG_SLOW, 0, NULL,
1980- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1981- { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore }
1982+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1983+ { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore, mh_not_server }
1984 },
1985 {
1986 MSG_REBURST,
1987 TOK_REBURST,
1988 0, MAXPARA, MFLG_SLOW, 0, NULL,
1989- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1990- { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore }
1991+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1992+ { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore, mh_not_server }
1993 },
1994 {
1995 MSG_HASH,
1996 TOK_HASH,
1997 0, MAXPARA, MFLG_SLOW, 0, NULL,
1998- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1999- { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore }
2000+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2001+ { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore, mh_hash }
2002 },
2003 {
2004 MSG_REHASH,
2005 TOK_REHASH,
2006 0, MAXPARA, MFLG_SLOW, 0, NULL,
2007- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2008- { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore }
2009+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2010+ { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore, mh_rehash }
2011 },
2012 {
2013 MSG_RESTART,
2014 TOK_RESTART,
2015 0, MAXPARA, MFLG_SLOW, 0, NULL,
2016- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2017- { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore }
2018+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2019+ { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore, mh_restart }
2020 },
2021 {
2022 MSG_DIE,
2023 TOK_DIE,
2024 0, MAXPARA, MFLG_SLOW, 0, NULL,
2025- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2026- { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore }
2027+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2028+ { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore, mh_die }
2029 },
2030 {
2031 MSG_PROTO,
2032 TOK_PROTO,
2033 0, MAXPARA, MFLG_SLOW, 0, NULL,
2034- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2035- { m_proto, m_proto, m_proto, m_proto, m_ignore }
2036+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2037+ { m_proto, m_proto, m_proto, m_proto, m_ignore, mh_nohelp }
2038 },
2039 {
2040 MSG_SET,
2041 TOK_SET,
2042 0, MAXPARA, MFLG_SLOW, 0, NULL,
2043- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2044- { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore }
2045+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2046+ { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore, mh_set }
2047 },
2048 {
2049 MSG_RESET,
2050 TOK_RESET,
2051 0, MAXPARA, MFLG_SLOW, 0, NULL,
2052- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2053- { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore }
2054+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2055+ { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore, mh_reset }
2056 },
2057 {
2058 MSG_GET,
2059 TOK_GET,
2060 0, MAXPARA, MFLG_SLOW, 0, NULL,
2061- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2062- { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore }
2063+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2064+ { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore, mh_get }
2065 },
2066 {
2067 MSG_PRIVS,
2068 TOK_PRIVS,
2069 0, MAXPARA, MFLG_SLOW, 0, NULL,
2070- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2071- { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore }
2072+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2073+ { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore, mh_privs }
2074 },
2075 {
2076 MSG_ACCOUNT,
2077 TOK_ACCOUNT,
2078 0, MAXPARA, MFLG_SLOW, 0, NULL,
2079- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2080- { m_ignore, m_ignore, ms_account, m_ignore, m_ignore }
2081+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2082+ { m_ignore, m_ignore, ms_account, m_ignore, m_ignore, mh_not_server }
2083 },
2084 {
2085 MSG_ASLL,
2086 TOK_ASLL,
2087 0, MAXPARA, MFLG_SLOW, 0, NULL,
2088- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2089- { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore }
2090+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2091+ { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore, mh_asll }
2092 },
2093 {
2094 MSG_SETHOST,
2095 TOK_SETHOST,
2096 0, MAXPARA, MFLG_SLOW, 0, NULL,
2097- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2098- { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore }
2099+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2100+ { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore, mh_sethost }
2101 },
2102 #if WE_HAVE_A_REAL_CAPABILITY_NOW
2103 {
2104 MSG_CAP,
2105 TOK_CAP,
2106 0, MAXPARA, 0, 0, NULL,
2107- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2108- { m_cap, m_cap, m_ignore, m_cap, m_ignore }
2109+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2110+ { m_cap, m_cap, m_ignore, m_cap, m_ignore, mh_nohelp }
2111 },
2112 #endif
2113
2114@@ -654,7 +654,7 @@
2115 MSG_CHECK,
2116 TOK_CHECK,
2117 0, MAXPARA, MFLG_SLOW, 0, NULL,
2118- { m_unregistered, m_not_oper, m_check, m_check, m_ignore }
2119+ { m_unregistered, m_not_oper, m_check, m_check, m_ignore, mh_check }
2120 },
2121
2122 /*
2123@@ -664,8 +664,8 @@
2124 MSG_OPKICK,
2125 TOK_OPKICK,
2126 0, MAXPARA, MFLG_SLOW, 0, NULL,
2127- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2128- { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore }
2129+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2130+ { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore, mh_nohelp }
2131 },
2132
2133 /* This command is an alias for QUIT during the unregistered part of
2134@@ -678,8 +678,8 @@
2135 MSG_POST,
2136 TOK_POST,
2137 0, MAXPARA, MFLG_SLOW, 0, NULL,
2138- /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2139- { m_quit, m_ignore, m_ignore, m_ignore, m_ignore }
2140+ /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2141+ { m_quit, m_ignore, m_ignore, m_ignore, m_ignore, mh_nohelp }
2142 },
2143 { 0 }
2144 };
2145@@ -779,6 +779,14 @@
2146 return NULL;
2147 }
2148
2149+/** Look up a command in the message trie.
2150+ * @param cmd Text of command to look up.
2151+ * @return Pointer to matching message, or NULL if non exists.
2152+ */
2153+struct Message *find_message_by_cmd(char *cmd) {
2154+ return msg_tree_parse(cmd, &msg_tree);
2155+}
2156+
2157 /** Registers a service mapping to the pseudocommand handler.
2158 * @param[in] map Service mapping to add.
2159 * @return Non-zero on success; zero if a command already used the name.
2160@@ -806,6 +814,7 @@
2161 msg->handlers[SERVER_HANDLER] = m_ignore;
2162 msg->handlers[OPER_HANDLER] = m_pseudo;
2163 msg->handlers[SERVICE_HANDLER] = m_ignore;
2164+ msg->handlers[HELP_HANDLER] = mh_nohelp;
2165
2166 add_msg_element(&msg_tree, msg, msg->cmd);
2167 map->msg = msg;
efbd1f63 2168diff -r 5a1e5e09c766 ircd/s_err.c
2169--- a/ircd/s_err.c Sat Jan 31 18:46:47 2009 +0100
2170+++ b/ircd/s_err.c Sat Jan 31 18:51:08 2009 +0100
a037f551 2171@@ -786,9 +786,9 @@
2172 /* 376 */
2173 { RPL_ENDOFMOTD, ":End of /MOTD command.", "376" },
2174 /* 377 */
2175- { 0 },
2176+ { RPL_HELP, 0, "377" },
2177 /* 378 */
2178- { 0 },
2179+ { RPL_ENDOFHELP, "%s :End of /HELP report.", "378" },
2180 /* 379 */
cddf800b 2181 { 0 },
a037f551 2182 /* 380 */
2183@@ -868,7 +868,7 @@
2184 /* 417 */
2185 { ERR_INPUTTOOLONG, ":Input line was too long", "417" },
2186 /* 418 */
2187- { 0 },
2188+ { ERR_NOHELP, "%s :No help found.", "418" },
2189 /* 419 */
2190 { 0 },
2191 /* 420 */