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