1 make /HELP <command> work - oper only feature?
2 need to make small test case to see how hard/easy this would be to add.
4 diff -r 7fa4708bac45 include/handlers.h
5 --- a/include/handlers.h Sun Jan 25 12:48:01 2009 +0100
6 +++ b/include/handlers.h Sun Jan 25 23:52:18 2009 +0100
8 extern int ms_wallvoices(struct Client*, struct Client*, int, char*[]);
9 extern int ms_whois(struct Client*, struct Client*, int, char*[]);
11 +extern int mh_nohelp(struct Client*, struct Client*, int, char*[]);
12 +extern int mh_not_oper(struct Client*, struct Client*, int, char*[]);
13 +extern int mh_not_server(struct Client*, struct Client*, int, char*[]);
14 +extern int mh_admin(struct Client*, struct Client*, int, char*[]);
15 +extern int mh_asll(struct Client*, struct Client*, int, char*[]);
16 +extern int mh_away(struct Client*, struct Client*, int, char*[]);
17 +extern int mh_check(struct Client*, struct Client*, int, char*[]);
18 +extern int mh_clearmode(struct Client*, struct Client*, int, char*[]);
19 +extern int mh_close(struct Client*, struct Client*, int, char*[]);
20 +extern int mh_cnotice(struct Client*, struct Client*, int, char*[]);
21 +extern int mh_connect(struct Client*, struct Client*, int, char*[]);
22 +extern int mh_cprivmsg(struct Client*, struct Client*, int, char*[]);
23 +extern int mh_die(struct Client*, struct Client*, int, char*[]);
24 +extern int mh_get(struct Client*, struct Client*, int, char*[]);
25 +extern int mh_gline(struct Client*, struct Client*, int, char*[]);
26 +extern int mh_hash(struct Client*, struct Client*, int, char*[]);
27 +extern int mh_help(struct Client*, struct Client*, int, char*[]);
28 +extern int mh_info(struct Client*, struct Client*, int, char*[]);
29 +extern int mh_invite(struct Client*, struct Client*, int, char*[]);
30 +extern int mh_ison(struct Client*, struct Client*, int, char*[]);
31 +extern int mh_join(struct Client*, struct Client*, int, char*[]);
32 +extern int mh_jupe(struct Client*, struct Client*, int, char*[]);
33 +extern int mh_kick(struct Client*, struct Client*, int, char*[]);
34 +extern int mh_kill(struct Client*, struct Client*, int, char*[]);
35 +extern int mh_links(struct Client*, struct Client*, int, char*[]);
36 +extern int mh_list(struct Client*, struct Client*, int, char*[]);
37 +extern int mh_lusers(struct Client*, struct Client*, int, char*[]);
38 +extern int mh_map(struct Client*, struct Client*, int, char*[]);
39 +extern int mh_mode(struct Client*, struct Client*, int, char*[]);
40 +extern int mh_motd(struct Client*, struct Client*, int, char*[]);
41 +extern int mh_names(struct Client*, struct Client*, int, char*[]);
42 +extern int mh_nick(struct Client*, struct Client*, int, char*[]);
43 +extern int mh_notice(struct Client*, struct Client*, int, char*[]);
44 +extern int mh_oper(struct Client*, struct Client*, int, char*[]);
45 +extern int mh_opmode(struct Client*, struct Client*, int, char*[]);
46 +extern int mh_part(struct Client*, struct Client*, int, char*[]);
47 +extern int mh_pass(struct Client*, struct Client*, int, char*[]);
48 +extern int mh_ping(struct Client*, struct Client*, int, char*[]);
49 +extern int mh_pong(struct Client*, struct Client*, int, char*[]);
50 +extern int mh_privmsg(struct Client*, struct Client*, int, char*[]);
51 +extern int mh_privs(struct Client*, struct Client*, int, char*[]);
52 +extern int mh_quit(struct Client*, struct Client*, int, char*[]);
53 +extern int mh_rehash(struct Client*, struct Client*, int, char*[]);
54 +extern int mh_reset(struct Client*, struct Client*, int, char*[]);
55 +extern int mh_restart(struct Client*, struct Client*, int, char*[]);
56 +extern int mh_rping(struct Client*, struct Client*, int, char*[]);
57 +extern int mh_set(struct Client*, struct Client*, int, char*[]);
58 +extern int mh_sethost(struct Client*, struct Client*, int, char*[]);
59 +extern int mh_settime(struct Client*, struct Client*, int, char*[]);
60 +extern int mh_silence(struct Client*, struct Client*, int, char*[]);
61 +extern int mh_squit(struct Client*, struct Client*, int, char*[]);
62 +extern int mh_stats(struct Client*, struct Client*, int, char*[]);
63 +extern int mh_time(struct Client*, struct Client*, int, char*[]);
64 +extern int mh_topic(struct Client*, struct Client*, int, char*[]);
65 +extern int mh_trace(struct Client*, struct Client*, int, char*[]);
66 +extern int mh_uping(struct Client*, struct Client*, int, char*[]);
67 +extern int mh_user(struct Client*, struct Client*, int, char*[]);
68 +extern int mh_userhost(struct Client*, struct Client*, int, char*[]);
69 +extern int mh_userip(struct Client*, struct Client*, int, char*[]);
70 +extern int mh_version(struct Client*, struct Client*, int, char*[]);
71 +extern int mh_wallchops(struct Client*, struct Client*, int, char*[]);
72 +extern int mh_wallops(struct Client*, struct Client*, int, char*[]);
73 +extern int mh_wallusers(struct Client*, struct Client*, int, char*[]);
74 +extern int mh_wallvoices(struct Client*, struct Client*, int, char*[]);
75 +extern int mh_who(struct Client*, struct Client*, int, char*[]);
76 +extern int mh_whois(struct Client*, struct Client*, int, char*[]);
77 +extern int mh_whowas(struct Client*, struct Client*, int, char*[]);
83 #endif /* INCLUDED_handlers_h */
85 diff -r 7fa4708bac45 include/ircd_handler.h
86 --- a/include/ircd_handler.h Sun Jan 25 12:48:01 2009 +0100
87 +++ b/include/ircd_handler.h Sun Jan 25 23:52:18 2009 +0100
89 SERVER_HANDLER, /**< Used for server conections. */
90 OPER_HANDLER, /**< Used for IRC operators. */
91 SERVICE_HANDLER, /**< Used for services connections. */
92 + HELP_HANDLER, /**< Used for /HELP <command> */
93 LAST_HANDLER_TYPE /**< NUmber of handler types. */
96 diff -r 7fa4708bac45 include/msg.h
97 --- a/include/msg.h Sun Jan 25 12:48:01 2009 +0100
98 +++ b/include/msg.h Sun Jan 25 23:52:18 2009 +0100
100 * parv = parameter variable array
103 - * UNREGISTERED, CLIENT, SERVER, OPER, SERVICE, LAST
104 + * UNREGISTERED, CLIENT, SERVER, OPER, SERVICE, HELP, LAST
106 MessageHandler handlers[LAST_HANDLER_TYPE];
108 diff -r 7fa4708bac45 include/numeric.h
109 --- a/include/numeric.h Sun Jan 25 12:48:01 2009 +0100
110 +++ b/include/numeric.h Sun Jan 25 23:52:18 2009 +0100
112 /* ERR_NOMANAGER_LONG 565 no longer used */
113 #define ERR_NOMANAGER 566 /* Undernet extension */
114 #define ERR_UPASS_SAME_APASS 567 /* Undernet extension */
115 -#define ERR_LASTERROR 568
117 /* RPL_LOGON 600 dalnet,unreal
118 RPL_LOGOFF 601 dalnet,unreal
120 RPL_DUMPRPL 641 unreal
121 RPL_EODUMP 642 unreal
123 +#define RPL_HELP 601 /* QuakeNet extension */
124 +#define RPL_ENDOFHELP 602 /* QuakeNet extension */
125 +#define ERR_NOHELP 603 /* QuakeNet extension */
127 +#define ERR_LASTERROR 604
129 #endif /* INCLUDED_numeric_h */
130 diff -r 7fa4708bac45 include/parse.h
131 --- a/include/parse.h Sun Jan 25 12:48:01 2009 +0100
132 +++ b/include/parse.h Sun Jan 25 23:52:18 2009 +0100
134 extern int parse_client(struct Client *cptr, char *buffer, char *bufend);
135 extern int parse_server(struct Client *cptr, char *buffer, char *bufend);
136 extern void initmsgtree(void);
137 +extern struct Message *find_message_by_cmd(char *cmd);
139 extern int register_mapping(struct s_map *map);
140 extern int unregister_mapping(struct s_map *map);
141 diff -r 7fa4708bac45 ircd/m_defaults.c
142 --- a/ircd/m_defaults.c Sun Jan 25 12:48:01 2009 +0100
143 +++ b/ircd/m_defaults.c Sun Jan 25 23:52:18 2009 +0100
149 +int mh_nohelp(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
151 + return send_reply(sptr, ERR_NOHELP, parv[1]);
154 +int mh_not_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
156 + return send_reply(sptr, SND_EXPLICIT | RPL_HELP, "%s :This command is for IRC Operators only.", parv[1]);
159 +int mh_not_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
161 + return send_reply(sptr, SND_EXPLICIT | RPL_HELP, "%s :This command is for servers only.", parv[1]);
163 \ No newline at end of file
164 diff -r 7fa4708bac45 ircd/m_help.c
165 --- a/ircd/m_help.c Sun Jan 25 12:48:01 2009 +0100
166 +++ b/ircd/m_help.c Sun Jan 25 23:52:18 2009 +0100
170 #include "numnicks.h"
174 /* #include <assert.h> -- Now using assert in ircd_log.h */
175 @@ -100,9 +101,1124 @@
176 int m_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
179 + struct Message* mptr;
180 + MessageHandler handler = 0;
183 - for (i = 0; msgtab[i].cmd; i++)
184 - sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd);
185 + /* list all commands */
187 + for (i = 0; msgtab[i].cmd; i++)
188 + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd);
193 + /* nothing found */
194 + if ((mptr = find_message_by_cmd(command)) == NULL)
195 + return send_reply(sptr, ERR_NOHELP, command);
197 + /* found a help handler function */
198 + handler = mptr->handlers[HELP_HANDLER];
200 + assert(0 != handler);
202 + /* call the help handler function */
203 + (*handler) (cptr, sptr, parc, parv);
204 + return send_reply(sptr, RPL_ENDOFHELP, command);
209 + * mh_help - help message handler
211 +int mh_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
213 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
214 + "HELP :HELP [<command>]");
215 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
216 + "HELP :Lists all server commands or info on the given command.");
222 + * TODO: move all the mh_ functions into the files of the commands they belong to
227 + * mh_admin - help message handler
228 + * TODO: check HIS remote
230 +int mh_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
232 + if (!IsAnOper(sptr))
233 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
236 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
237 + "ADMIN :ADMIN [<server>]");
238 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
239 + "ADMIN :Shows administrative contact for the server.");
245 + * mh_asll - help message handler
247 +int mh_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
249 + if (!IsAnOper(sptr))
250 + return mh_not_oper(cptr, sptr, parc, parv);
251 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
252 + "ASLL :ASLL <mask> [<server>]");
253 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
254 + "ASLL :Shows Asymmetric Link Latency information.");
255 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
256 + "ASLL :Parameter <mask> is matched against directly linked servers, and may have more than one match.");
262 + * mh_away - help message handler
264 +int mh_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
266 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
267 + "AWAY :AWAY [<message>]");
268 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
269 + "AWAY :Sets or clears the away message.");
275 + * mh_check - help message handler
277 +int mh_check(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
279 + if (!IsAnOper(sptr))
280 + return mh_not_oper(cptr, sptr, parc, parv);
281 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
282 + "CHECK :CHECK [<server>] <mask> [<flags>]");
283 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
284 + "CHECK :Shows detailed information about a user, a channel, a hostmask, or a server.");
285 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
286 + "CHECK :Flags are: -C show clones, -c show channels, -s show servernames, -e show more, "
287 + "-i show IPs, -I show hostnames and IPs, -u do not show users, -o show only channel operators.");
293 + * mh_clearmode - help message handler
295 +int mh_clearmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
297 + if (!IsAnOper(sptr))
298 + return mh_not_oper(cptr, sptr, parc, parv);
299 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
300 + "CLEARMODE :CLEARMODE [!]<channel> [<modes>]");
301 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
302 + "CLEARMODE :Clears modes on a channel.");
303 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
304 + "CLEARMODE :Default modes are ovpsmikbl - o deops all channel operators, "
305 + "v devoices all channel voices, and b removes all channel bans.");
306 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
307 + "CLEARMODE :The ! prefix may be used to override a channel quarantine.");
313 + * mh_close - help message handler
315 +int mh_close(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
317 + if (!IsAnOper(sptr))
318 + return mh_not_oper(cptr, sptr, parc, parv);
319 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
321 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
322 + "CLOSE :Closes unregistered connections to the server.");
328 + * mh_cnotice - help message handler
330 +int mh_cnotice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
332 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
333 + "CNOTICE :CNOTICE <nick> <channel> :<message>");
334 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
335 + "CNOTICE :Sends a private notice to a user.");
336 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
337 + "CNOTICE :A channel voice or operator can use this to bypass the target flood limit "
338 + "(target change too fast error) when the user is on the channel.");
344 + * mh_connect - help message handler
346 +int mh_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
348 + if (!IsAnOper(sptr))
349 + return mh_not_oper(cptr, sptr, parc, parv);
350 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
351 + "CONNECT :CONNECT <server> [<port> [<remote server>]]");
352 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
353 + "CONNECT :Connects the server to another server.");
354 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
355 + "CONNECT :Special port 0 can be used to let the remote server workout the port to use.");
361 + * mh_cprivmsg - help message handler
363 +int mh_cprivmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
365 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
366 + "CPRIVMSG :CPRIVMSG <nick> <channel> :<message>");
367 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
368 + "CPRIVMSG :Sends a private message to a user.");
369 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
370 + "CPRIVMSG :A channel voice or operator can use this to bypass the target flood limit "
371 + "(target change too fast error) when the user is on the channel.");
377 + * mh_die - help message handler
379 +int mh_die(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
381 + if (!IsAnOper(sptr))
382 + return mh_not_oper(cptr, sptr, parc, parv);
383 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
384 + "DIE :DIE <server>");
385 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
386 + "DIE :Terminates the server. The servername needs to be given as sanity check.");
392 + * mh_get - help message handler
395 +int mh_get(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
397 + if (!IsAnOper(sptr))
398 + return mh_not_oper(cptr, sptr, parc, parv);
399 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
400 + "GET :GET <feature> [<parameters>]");
401 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
402 + "GET :Returns the value of a feature.");
408 + * mh_gline - help message handler
411 +int mh_gline(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
413 + if (!IsAnOper(sptr))
414 + return mh_not_oper(cptr, sptr, parc, parv);
415 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
416 + "GLINE :GLINE [[!][+|-|>|<]<mask> [<target>] [<duration> [:<reason>]]]");
417 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
418 + "GLINE :Views, sets or changes a gline.");
424 + * mh_hash - help message handler
427 +int mh_hash(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
429 + if (!IsAnOper(sptr))
430 + return mh_not_oper(cptr, sptr, parc, parv);
431 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
433 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
434 + "HASH :Shows hash table statistics.");
440 + * mh_info - help message handler
441 + * TODO: check HIS remote
443 +int mh_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
445 + if (!IsAnOper(sptr)) {
446 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO");
447 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :Shows info about the IRCd.");
448 + return mh_not_oper(cptr, sptr, parc, parv);
450 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO [<server>]");
451 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
452 + "INFO :Show info about the IRCd. Lists a file hash and version number for its source files.");
459 + * mh_invite - help message handler
461 +int mh_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
463 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
464 + "INVITE :INVITE <nick> <channel>");
465 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
466 + "INVITE :Invites a user to a channel.");
472 + * mh_ison - help message handler
473 + * TODO: check that syntax is clear - no limit on number of nicks
475 +int mh_ison(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
477 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
478 + "ISON :ISON <nick> [<nick> [..]]");
479 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
480 + "ISON :Returns the nicks that are on the network.");
486 + * mh_join - help message handler
488 +int mh_join(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
490 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
491 + "JOIN :JOIN <channel> [<key>]");
492 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
493 + "JOIN :Joins a channel, where <channel> and <key> are a comma separated list of one or more elements.");
494 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
495 + "JOIN :Joining channel 0 can be used to leave all channels.");
501 + * mh_jupe - help message handler
504 +int mh_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
506 + if (!IsAnOper(sptr))
507 + return mh_not_oper(cptr, sptr, parc, parv);
508 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
509 + "JUPE :JUPE [[+|-]<server> [[<target>] <duration> :<reason>]]");
510 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
511 + "JUPE :Views or manipulates server jupes.");
517 + * mh_kick - help message handler
519 +int mh_kick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
521 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
522 + "KICK :KICK <channel> <nick> [:<reason>]");
523 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
524 + "KICK :Kicks a user from a channel.");
530 + * mh_kill - help message handler
532 +int mh_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
534 + if (!IsAnOper(sptr))
535 + return mh_not_oper(cptr, sptr, parc, parv);
536 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
537 + "KILL :KILL <nick> :<reason>");
538 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
539 + "KILL :Disconnects a user from the network.");
545 + * mh_links - help message handler
546 + * TODO: check HIS feature
548 +int mh_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
550 + if (!IsAnOper(sptr))
551 + return mh_not_oper(cptr, sptr, parc, parv);
552 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
553 + "LINKS :LINKS [[<remote server>] <mask>]");
554 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
555 + "LINKS :Shows server links on the network.");
561 + * mh_list - help message handler
563 +int mh_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
565 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
566 + "LIST :LIST :[<channel>|<parameters>|STOP]");
567 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
568 + "LIST :Lists channels on the network. See \"/QUOTE LIST :\" for more info.");
569 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
570 + "LIST :Parameter <channel> is a comma separated list of one or more channels.");
576 + * mh_lusers - help message handler
577 + * TODO: check HIS remote feature
579 +int mh_lusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
581 + if (!IsAnOper(sptr))
582 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
585 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
586 + "LUSERS :LUSERS [<dummy> [<remote server>]]");
587 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
588 + "LUSERS :Shows information about the number of users on the network.");
594 + * mh_map - help message handler
595 + * TODO: check HIS feature
597 +int mh_map(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
599 + if (!IsAnOper(sptr))
600 + return mh_not_oper(cptr, sptr, parc, parv);
601 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
602 + "MAP :MAP [<mask>]");
603 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
604 + "MAP :Shows a map of the servers on the network.");
610 + * mh_mode - help message handler
611 + * TODO: check syntax is clear
613 +int mh_mode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
615 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
616 + "MODE :MODE <channel>|<nick> [<modes>]");
617 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
618 + "MODE :Views or changes modes of a channel or user.");
624 + * mh_motd - help message handler
625 + * TODO: check HIS remote feature
627 +int mh_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
629 + if (!IsAnOper(sptr))
630 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
633 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
634 + "MOTD :MOTD [<server>]");
635 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
636 + "MOTD :Shows the Message Of The Day.");
642 + * mh_names - help message handler
643 + * TODO: check HIS remote feature
645 +int mh_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
647 + if (!IsAnOper(sptr))
648 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
649 + "NAMES :NAMES [[-D] <channel>]");
651 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
652 + "NAMES :NAMES [[[-D] [channel]] [<server>]]");
653 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
654 + "NAMES :Shows the names of users on the channel.");
655 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
656 + "NAMES :Parameter <channel> is a comma separated list of one or more channels,"
657 + " and the -D option is for listing delayedjoin users.");
663 + * mh_nick - help message handler
665 +int mh_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
667 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
668 + "NICK :NICK <newnick>");
669 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
670 + "NICK :Changes nickname.");
676 + * mh_notice - help message handler
678 +int mh_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
680 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
681 + "NOTICE :NOTICE <target> :<message>");
682 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
683 + "NOTICE :Sends a notice to a target, where <target> can be a comma separated list of one or more nicks or channels.");
684 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
685 + "NOTICE :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS).");
686 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
687 + "NOTICE :Parameter <target> can be in the form of <nick>@<server> to send to a service.");
688 + if (IsAnOper(sptr)) {
689 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
690 + "NOTICE :Parameter <target> can be a $<servername> to broadcast a message to all users on a server.");
691 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
692 + "NOTICE :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host.");
699 + * mh_oper - help message handler
701 +int mh_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
703 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
704 + "OPER :OPER <username> <password>");
705 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
706 + "OPER :Logs in as IRC Operator.");
712 + * mh_opmode - help message handler
714 +int mh_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
716 + if (!IsAnOper(sptr))
717 + return mh_not_oper(cptr, sptr, parc, parv);
718 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
719 + "OPMODE :OPMODE [!]<channel> <modes>");
720 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
721 + "OPMODE :Changes modes on a channel.");
722 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
723 + "OPMODE :The ! prefix may be used to override a channel quarantine.");
728 + * mh_part - help message handler
730 +int mh_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
732 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
733 + "PART :PART <channel> [:<message>]");
734 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
735 + "PART :Parts a channel with an optional message.");
736 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
737 + "PART :Parameter <channel> is a comma separated list of one or more channels.");
743 + * mh_pass - help message handler
745 +int mh_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
747 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
748 + "PASS :PASS :<password>");
749 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
750 + "PASS :Provides the password required to connect to the server.");
756 + * mh_ping - help message handler
759 +int mh_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
761 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
762 + "PING :PING :<text>");
763 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
764 + "PING :Sends a ping to the server.");
770 + * mh_pong - help message handler
773 +int mh_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
775 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
776 + "PONG :PONG :<text>");
777 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
778 + "PONG :Sends a pong as reply to a PING from the server.");
784 + * mh_privmsg - help message handler
786 +int mh_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
788 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
789 + "PRIVMSG :PRIVMSG <target> :<message>");
790 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
791 + "PRIVMSG :Sends a message to a target, where <target> can be a comma separated list of one or more nicks or channels.");
792 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
793 + "PRIVMSG :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS).");
794 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
795 + "PRIVMSG :Parameter <target> can be in the form of <nick>@<server> to send to a service.");
796 + if (IsAnOper(sptr)) {
797 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
798 + "PRIVMSG :Parameter <target> can be a $<servername> to broadcast a message to all users on a server.");
799 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
800 + "PRIVMSG :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host.");
807 + * mh_privs - help message handler
809 +int mh_privs(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
811 + if (!IsAnOper(sptr))
812 + return mh_not_oper(cptr, sptr, parc, parv);
813 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
814 + "PRIVS :PRIVS <nick> [<nick> [..]]");
815 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
816 + "PRIVS :Shows the privileges an IRC Operator has.");
822 + * mh_quit - help message handler
823 + * TODO: Disconnect or Disconnects?
825 +int mh_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
827 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
828 + "QUIT :QUIT :<message>");
829 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
830 + "QUIT :Disconnect from the network with an optional message.");
836 + * mh_rehash - help message handler
837 + * TODO: check the options, etc.
839 +int mh_rehash(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
841 + if (!IsAnOper(sptr))
842 + return mh_not_oper(cptr, sptr, parc, parv);
843 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
844 + "REHASH :REHASH [L|M|Q]");
845 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
846 + "REHASH :Reloads the server conf file, MOTD, and log files.");
847 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
848 + "REHASH :Where L reopens the log files, M flushes the MOTD cache, Q the DNS resolver is not restarted.");
854 + * mh_reset - help message handler
856 +int mh_reset(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
858 + if (!IsAnOper(sptr))
859 + return mh_not_oper(cptr, sptr, parc, parv);
860 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
861 + "RESET :RESET <feature> [<parameters>]");
862 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
863 + "RESET :Resets a feature to its default hardcoded value.");
869 + * mh_restart - help message handler
871 +int mh_restart(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
873 + if (!IsAnOper(sptr))
874 + return mh_not_oper(cptr, sptr, parc, parv);
875 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
876 + "RESTART :RESTART <server>");
877 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
878 + "RESTART :Restarts the server. The servername needs to be given as sanity check.");
884 + * mh_rping - help message handler
887 +int mh_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
889 + if (!IsAnOper(sptr))
890 + return mh_not_oper(cptr, sptr, parc, parv);
891 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
892 + "RPING :RPING <server> [<remote server>] [:<text>]");
893 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
894 + "RPING :Pings a remote server and returns the Round Trip Time in milliseconds.");
900 + * mh_set - help message handler
902 +int mh_set(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
904 + if (!IsAnOper(sptr))
905 + return mh_not_oper(cptr, sptr, parc, parv);
906 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
907 + "SET :SET <feature> [<parameters>] :<value>");
908 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
909 + "SET :Changes the value of a feature.");
915 + * mh_sethost - help message handler
917 +int mh_sethost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
919 + if (!IsAnOper(sptr)) {
920 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
921 + "SETHOST :SETHOST <spoofhost> <password>");
922 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
923 + "SETHOST :Sets a spoof host.");
925 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
926 + "SETHOST :SETHOST <user> <host>");
927 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
928 + "SETHOST :Sets a spoof user@host.");
935 + * mh_settime - help message handler
937 +int mh_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
939 + if (!IsAnOper(sptr))
940 + return mh_not_oper(cptr, sptr, parc, parv);
941 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
942 + "SETTIME :SETTIME <timestamp> [<server>]");
943 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
944 + "SETTIME :Changes the time on a server."
945 + "When parameter <timestamp> is 0 the local server "
946 + "uses its own timestamp before sending it to the remote server.");
952 + * mh_silence - help message handler
953 + * TODO: mention ~ exempt mask prefix
955 +int mh_silence(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
957 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
958 + "SILENCE :SILENCE [[+|-]<mask>|<nick>]");
959 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
960 + "SILENCE :Views or changes the silence list.");
961 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
962 + "SILENCE :Parameter <mask> is a comma separated list of one or more masks.");
963 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
964 + "SILENCE :Silence is a server side ignore -"
965 + " any message sent privately or invites from a user matching a silence mask is dropped.");
971 + * mh_squit - help message handler
973 +int mh_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
975 + if (!IsAnOper(sptr))
976 + return mh_not_oper(cptr, sptr, parc, parv);
977 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
978 + "SQUIT :SQUIT <server> [:<reason>]");
979 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
980 + "SQUIT :Disconnects a server from the network.");
986 + * mh_stats - help message handler
987 + * TODO: check HIS (too many per stats type) / HIS remote?
989 +int mh_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
991 + if (!IsAnOper(sptr))
992 + return mh_not_oper(cptr, sptr, parc, parv);
993 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
994 + "STATS :STATS [<type> [[<server>] [<mask>]]]");
995 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
996 + "STATS :Shows server configuration and statistics.");
1002 + * mh_time - help message handler
1003 + * TODO: check HIS remote feature
1005 +int mh_time(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1007 + if (!IsAnOper(sptr)) {
1008 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1010 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1011 + "TIME :Shows the time on the server.");
1014 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1015 + "TIME :TIME [<server>]");
1016 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1017 + "TIME :Shows the time on the server.");
1018 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1019 + "TIME :Parameter <server> can be a * to view the time from all servers.");
1027 + * mh_topic - help message handler
1029 +int mh_topic(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1031 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1032 + "TOPIC :TOPIC <channel> [:<text>]");
1033 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1034 + "TOPIC :Views or changes the topic on a channel.");
1035 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1036 + "TOPIC :Parameter <channel> is a comma separated list of one or more channels.");
1042 + * mh_trace - help message handler
1043 + * TODO: check HIS / HIS remote?
1044 + * TODO: check <to server> parameter
1046 +int mh_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1048 + if (!IsAnOper(sptr))
1049 + return mh_not_oper(cptr, sptr, parc, parv);
1050 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1051 + "TRACE :TRACE [<nick>|<server> <to server>]");
1052 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1053 + "TRACE :Shows the route to a user or server.");
1059 + * mh_uping - help message handler
1060 + * TODO: default port 7007, define UDP_PORT
1062 +int mh_uping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1064 + if (!IsAnOper(sptr))
1065 + return mh_not_oper(cptr, sptr, parc, parv);
1066 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1067 + "UPING :UPING <server> [<port>] [<remote server>] [<number of packets>]");
1068 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1069 + "UPING :Pings the host of the server with UDP packets - server does not have to be linked.");
1070 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1071 + "UPING :By default port 7007 is used, and 5 packets are sent (maximum is 20).");
1077 + * mh_user - help message handler
1079 +int mh_user(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1081 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1082 + "USER :USER <username> <hostname> <servername> :<realname>");
1083 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1084 + "USER :Registers a new client connection. Parameters <hostname> and <servername> are ignored.");
1090 + * mh_userhost - help message handler
1091 + * TODO: syntax clear?
1094 +int mh_userhost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1096 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1097 + "USERHOST :USERHOST <nick> [<nick> [..]]");
1098 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1099 + "USERHOST :Returns the user@host for a user.");
1105 + * mh_userip - help message handler
1106 + * TODO: syntax clear?
1109 +int mh_userip(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1111 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1112 + "USERIP :USERIP <nick> [<nick> [..]]");
1113 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1114 + "USERIP :Returns the user@ip for a user.");
1120 + * mh_version - help message handler
1121 + * TODO: check HIS remote feature
1123 +int mh_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1125 + if (!IsAnOper(sptr)) {
1126 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1127 + "VERSION :VERSION");
1128 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1129 + "VERSION :Shows information about the server, and the supported features and settings.");
1132 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1133 + "VERSION :VERSION [<server>]");
1134 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1135 + "VERSION :Shows information about the server, and the supported features and settings.");
1136 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1137 + "VERSION :Parameter <server> can be a * to view the version info from all servers.");
1144 + * mh_wallchops - help message handler
1145 + * TODO: mention NOTICE @#channel?
1147 +int mh_wallchops(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1149 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1150 + "WALLCHOPS :WALLCHOPS <channel> :<message>");
1151 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1152 + "WALLCHOPS :Sends a channel notice to the operators on a channel.");
1158 + * mh_wallops - help message handler
1159 + * TODO: check HIS ?
1161 +int mh_wallops(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1163 + if (!IsAnOper(sptr))
1164 + return mh_not_oper(cptr, sptr, parc, parv);
1165 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1166 + "WALLOPS :WALLOPS :<message>");
1167 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1168 + "WALLOPS :Sends a message to all IRC Operators with usermode +w set.");
1174 + * mh_wallusers - help message handler
1176 +int mh_wallusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1178 + if (!IsAnOper(sptr))
1179 + return mh_not_oper(cptr, sptr, parc, parv);
1180 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1181 + "WALLUSERS :WALLUSERS :<message>");
1182 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1183 + "WALLUSERS :Sends a message to all users with usermode +w set.");
1189 + * mh_wallvoices - help message handler
1191 +int mh_wallvoices(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1193 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1194 + "WALLVOICES :WALLVOICES <channel> :<message>");
1195 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1196 + "WALLVOICES :Sends a channel notice to the voices and operators on a channel.");
1202 + * mh_who - help message handler
1203 + * TODO: this is all way too much to add here.. :(
1204 + * TODO: mention <mask> - chan, nick, user, host, ip, server, realname
1206 +d Join-delayed channel members
1207 +o IRC Operator (specifying this one means only opers are matched)
1209 + * TODO: x for operators
1212 +n Nick, u Username, h Hostname, i Numeric IP,
1213 +s Servername, r Realname, a Account name
1217 +t Include the querytype in the reply
1218 +c Include (first) channel name (* when none can be shown)
1219 +u Include userID with eventual ~
1222 +s Include server name
1225 +d Include "distance" in hops
1226 +l Include idle time (0 for remote users)
1227 +a Include account name (0 when the user has no account set)
1229 +r Include real name
1230 +b Include account ID
1232 + * TODO: HIS settings
1234 +int mh_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1236 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1237 + "WHO :WHO <mask> [[<match>][%<fields>[,<querytype>]] [:<mask>]]");
1238 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1239 + "WHO :Returns information on a user.");
1240 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1241 + "WHO :Parameter <mask> can be a comma separated list of one or more nicks and channels.");
1247 + * mh_whois - help message handler
1248 + * TODO: check HIS / HIS remote
1250 +int mh_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1252 + if (!IsAnOper(sptr)) {
1253 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1254 + "WHOIS :WHOIS [<dummy>] <nick>");
1255 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1256 + "WHOIS :Shows who someone is.");
1257 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1258 + "WHOIS :Parameter <nick> is a comma separated list of one or more nicks,"
1259 + " <dummy> can be specified to get a reply from the user's server to show idle and signon time");
1262 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1263 + "WHOIS :WHOIS [<server>] <nick>");
1264 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1265 + "WHOIS :Shows who someone is.");
1266 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1267 + "WHOIS :Parameter <nick> is a comma separated list of one or more nicks,"
1268 + " the same nick can be specified as <server> to get a reply from the user's server to show idle and signon time");
1275 + * mh_whowas - help message handler
1276 + * TODO: check HIS / HIS remote
1277 + * TODO: see if 20 is a define
1279 +int mh_whowas(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1281 + if (!IsAnOper(sptr)) {
1282 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1283 + "WHOWAS :WHOWAS <nick> [<max>]");
1284 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1285 + "WHOWAS :Shows who someone was.");
1286 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1287 + "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks,"
1288 + " <max> is 0 by default (unlimited).");
1291 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1292 + "WHOWAS :WHOIS <nick> [<max> [<server>]]");
1293 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1294 + "WHOWAS :Shows who someone was.");
1295 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1296 + "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks,"
1297 + " <max> is 0 by default (unlimited),"
1298 + " maximum number of results from a remote server is 20.");
1302 \ No newline at end of file
1303 diff -r 7fa4708bac45 ircd/parse.c
1304 --- a/ircd/parse.c Sun Jan 25 12:48:01 2009 +0100
1305 +++ b/ircd/parse.c Sun Jan 25 23:52:18 2009 +0100
1306 @@ -110,534 +110,534 @@
1309 0, MAXPARA, MFLG_SLOW, 0, NULL,
1310 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1311 - { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore }
1312 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1313 + { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore, mh_privmsg }
1318 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1319 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1320 - { m_nick, m_nick, ms_nick, m_nick, m_ignore }
1321 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1322 + { m_nick, m_nick, ms_nick, m_nick, m_ignore, mh_nick }
1327 0, MAXPARA, MFLG_SLOW | MFLG_IGNORE, 0, NULL,
1328 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1329 - { m_ignore, m_notice, ms_notice, mo_notice, m_ignore }
1330 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1331 + { m_ignore, m_notice, ms_notice, mo_notice, m_ignore, mh_notice }
1336 0, MAXPARA, MFLG_SLOW, 0, NULL,
1337 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1338 - { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore }
1339 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1340 + { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore, mh_wallchops }
1345 0, MAXPARA, MFLG_SLOW, 0, NULL,
1346 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1347 - { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore }
1348 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1349 + { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore, mh_wallvoices }
1354 0, MAXPARA, MFLG_SLOW, 0, NULL,
1355 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1356 - { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore }
1357 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1358 + { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore, mh_cprivmsg }
1363 0, MAXPARA, MFLG_SLOW, 0, NULL,
1364 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1365 - { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore }
1366 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1367 + { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore, mh_cnotice }
1372 0, MAXPARA, MFLG_SLOW, 0, NULL,
1373 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1374 - { m_unregistered, m_join, ms_join, m_join, m_ignore }
1375 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1376 + { m_unregistered, m_join, ms_join, m_join, m_ignore, mh_join }
1381 0, MAXPARA, MFLG_SLOW, 0, NULL,
1382 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1383 - { m_unregistered, m_mode, ms_mode, m_mode, m_ignore }
1384 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1385 + { m_unregistered, m_mode, ms_mode, m_mode, m_ignore, mh_mode }
1390 0, MAXPARA, MFLG_SLOW, 0, NULL,
1391 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1392 - { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore }
1393 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1394 + { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore, mh_not_server }
1399 0, MAXPARA, MFLG_SLOW, 0, NULL,
1400 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1401 - { m_ignore, m_ignore, ms_create, m_ignore, m_ignore }
1402 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1403 + { m_ignore, m_ignore, ms_create, m_ignore, m_ignore, mh_not_server }
1408 0, MAXPARA, MFLG_SLOW, 0, NULL,
1409 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1410 - { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore }
1411 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1412 + { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore, mh_not_server }
1417 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1418 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1419 - { m_quit, m_quit, ms_quit, m_quit, m_ignore }
1420 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1421 + { m_quit, m_quit, ms_quit, m_quit, m_ignore, mh_quit }
1426 0, MAXPARA, MFLG_SLOW, 0, NULL,
1427 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1428 - { m_unregistered, m_part, ms_part, m_part, m_ignore }
1429 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1430 + { m_unregistered, m_part, ms_part, m_part, m_ignore, mh_part }
1435 0, MAXPARA, MFLG_SLOW, 0, NULL,
1436 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1437 - { m_unregistered, m_topic, ms_topic, m_topic, m_ignore }
1438 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1439 + { m_unregistered, m_topic, ms_topic, m_topic, m_ignore, mh_topic }
1444 0, MAXPARA, MFLG_SLOW, 0, NULL,
1445 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1446 - { m_unregistered, m_invite, ms_invite, m_invite, m_ignore }
1447 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1448 + { m_unregistered, m_invite, ms_invite, m_invite, m_ignore, mh_invite }
1453 0, MAXPARA, MFLG_SLOW, 0, NULL,
1454 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1455 - { m_unregistered, m_kick, ms_kick, m_kick, m_ignore }
1456 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1457 + { m_unregistered, m_kick, ms_kick, m_kick, m_ignore, mh_kick }
1462 0, MAXPARA, MFLG_SLOW, 0, NULL,
1463 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1464 - { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore }
1465 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1466 + { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore, mh_wallops }
1471 0, MAXPARA, MFLG_SLOW, 0, NULL,
1472 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1473 - { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore }
1474 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1475 + { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore, mh_wallusers }
1480 0, MAXPARA, MFLG_SLOW, 0, NULL,
1481 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1482 - { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore }
1483 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1484 + { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore, mh_not_server }
1489 0, MAXPARA, MFLG_SLOW, 0, NULL,
1490 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1491 - { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore }
1492 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1493 + { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore, mh_ping }
1498 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1499 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1500 - { mr_pong, m_pong, ms_pong, m_pong, m_ignore }
1501 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1502 + { mr_pong, m_pong, ms_pong, m_pong, m_ignore, mh_pong }
1507 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1508 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1509 - { mr_error, m_ignore, ms_error, m_ignore, m_ignore }
1510 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1511 + { mr_error, m_ignore, ms_error, m_ignore, m_ignore, mh_not_server }
1516 0, MAXPARA, MFLG_SLOW, 0, NULL,
1517 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1518 - { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore }
1519 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1520 + { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore, mh_kill }
1525 0, MAXPARA, MFLG_SLOW, 0, NULL,
1526 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1527 - { m_user, m_registered, m_ignore, m_registered, m_ignore }
1528 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1529 + { m_user, m_registered, m_ignore, m_registered, m_ignore, mh_user }
1534 0, MAXPARA, MFLG_SLOW, 0, NULL,
1535 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1536 - { m_unregistered, m_away, ms_away, m_away, m_ignore }
1537 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1538 + { m_unregistered, m_away, ms_away, m_away, m_ignore, mh_away }
1543 0, 1, MFLG_SLOW, 0, NULL,
1544 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1545 - { m_unregistered, m_ison, m_ignore, m_ison, m_ignore }
1546 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1547 + { m_unregistered, m_ison, m_ignore, m_ison, m_ignore, mh_ison }
1552 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1553 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1554 - { mr_server, m_registered, ms_server, m_registered, m_ignore }
1555 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1556 + { mr_server, m_registered, ms_server, m_registered, m_ignore, mh_not_server }
1561 0, MAXPARA, MFLG_SLOW, 0, NULL,
1562 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1563 - { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore }
1564 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1565 + { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore, mh_squit }
1570 0, MAXPARA, MFLG_SLOW, 0, NULL,
1571 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1572 - { m_unregistered, m_whois, ms_whois, m_whois, m_ignore }
1573 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1574 + { m_unregistered, m_whois, ms_whois, m_whois, m_ignore, mh_whois }
1579 0, MAXPARA, MFLG_SLOW, 0, NULL,
1580 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1581 - { m_unregistered, m_who, m_ignore, m_who, m_ignore }
1582 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1583 + { m_unregistered, m_who, m_ignore, m_who, m_ignore, mh_who }
1588 0, MAXPARA, MFLG_SLOW, 0, NULL,
1589 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1590 - { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore }
1591 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1592 + { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore, mh_whowas }
1597 0, MAXPARA, MFLG_SLOW, 0, NULL,
1598 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1599 - { m_unregistered, m_list, m_ignore, m_list, m_ignore }
1600 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1601 + { m_unregistered, m_list, m_ignore, m_list, m_ignore, mh_list }
1606 0, MAXPARA, MFLG_SLOW, 0, NULL,
1607 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1608 - { m_unregistered, m_names, m_names, m_names, m_ignore }
1609 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1610 + { m_unregistered, m_names, m_names, m_names, m_ignore, mh_names }
1615 0, 1, MFLG_SLOW, 0, NULL,
1616 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1617 - { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore }
1618 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1619 + { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore, mh_userhost }
1624 0, 1, MFLG_SLOW, 0, NULL,
1625 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1626 - { m_unregistered, m_userip, m_ignore, m_userip, m_ignore }
1627 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1628 + { m_unregistered, m_userip, m_ignore, m_userip, m_ignore, mh_userip }
1633 0, MAXPARA, MFLG_SLOW, 0, NULL,
1634 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1635 - { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore }
1636 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1637 + { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore, mh_trace }
1642 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1643 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1644 - { mr_pass, m_registered, m_ignore, m_registered, m_ignore }
1645 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1646 + { mr_pass, m_registered, m_ignore, m_registered, m_ignore, mh_pass }
1651 0, MAXPARA, MFLG_SLOW, 0, NULL,
1652 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1653 - { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore }
1654 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1655 + { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore, mh_lusers }
1660 0, MAXPARA, MFLG_SLOW, 0, NULL,
1661 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1662 - { m_unregistered, m_time, m_time, m_time, m_ignore }
1663 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1664 + { m_unregistered, m_time, m_time, m_time, m_ignore, mh_time }
1669 0, MAXPARA, MFLG_SLOW, 0, NULL,
1670 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1671 - { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore }
1672 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1673 + { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore, mh_settime }
1678 0, MAXPARA, MFLG_SLOW, 0, NULL,
1679 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1680 - { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore }
1681 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1682 + { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore, mh_rping }
1687 0, MAXPARA, MFLG_SLOW, 0, NULL,
1688 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1689 - { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore }
1690 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1691 + { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore, mh_not_server }
1696 0, MAXPARA, MFLG_SLOW, 0, NULL,
1697 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1698 - { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore }
1699 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1700 + { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore, mh_oper }
1705 0, MAXPARA, MFLG_SLOW, 0, NULL,
1706 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1707 - { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore }
1708 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1709 + { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore, mh_connect }
1714 0, MAXPARA, MFLG_SLOW, 0, NULL,
1715 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1716 - { m_unregistered, m_map, m_ignore, m_map, m_ignore }
1717 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1718 + { m_unregistered, m_map, m_ignore, m_map, m_ignore, mh_map }
1723 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1724 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1725 - { m_version, m_version, ms_version, mo_version, m_ignore }
1726 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1727 + { m_version, m_version, ms_version, mo_version, m_ignore, mh_version }
1732 0, MAXPARA, MFLG_SLOW, 0, NULL,
1733 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1734 - { m_unregistered, m_stats, m_stats, m_stats, m_ignore }
1735 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1736 + { m_unregistered, m_stats, m_stats, m_stats, m_ignore, mh_stats }
1741 0, MAXPARA, MFLG_SLOW, 0, NULL,
1742 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1743 - { m_unregistered, m_links, ms_links, m_links, m_ignore }
1744 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1745 + { m_unregistered, m_links, ms_links, m_links, m_ignore, mh_links }
1750 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1751 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1752 - { m_admin, m_admin, ms_admin, mo_admin, m_ignore }
1753 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1754 + { m_admin, m_admin, ms_admin, mo_admin, m_ignore, mh_admin }
1759 0, MAXPARA, MFLG_SLOW, 0, NULL,
1760 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1761 - { m_unregistered, m_help, m_ignore, m_help, m_ignore }
1762 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1763 + { m_unregistered, m_help, m_ignore, m_help, m_ignore, mh_help }
1768 0, MAXPARA, MFLG_SLOW, 0, NULL,
1769 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1770 - { m_unregistered, m_info, ms_info, mo_info, m_ignore }
1771 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1772 + { m_unregistered, m_info, ms_info, mo_info, m_ignore, mh_info }
1777 0, MAXPARA, MFLG_SLOW, 0, NULL,
1778 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1779 - { m_unregistered, m_motd, m_motd, m_motd, m_ignore }
1780 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1781 + { m_unregistered, m_motd, m_motd, m_motd, m_ignore, mh_motd }
1786 0, MAXPARA, MFLG_SLOW, 0, NULL,
1787 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1788 - { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore }
1789 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1790 + { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore, mh_close }
1795 0, MAXPARA, MFLG_SLOW, 0, NULL,
1796 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1797 - { m_unregistered, m_silence, ms_silence, m_silence, m_ignore }
1798 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1799 + { m_unregistered, m_silence, ms_silence, m_silence, m_ignore, mh_silence }
1804 0, MAXPARA, 0, 0, NULL,
1805 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1806 - { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore }
1807 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1808 + { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore, mh_gline }
1813 0, MAXPARA, MFLG_SLOW, 0, NULL,
1814 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1815 - { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore }
1816 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1817 + { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore, mh_jupe }
1822 0, MAXPARA, MFLG_SLOW, 0, NULL,
1823 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1824 - { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore }
1825 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1826 + { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore, mh_opmode }
1831 0, MAXPARA, MFLG_SLOW, 0, NULL,
1832 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1833 - { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore }
1834 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1835 + { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore, mh_clearmode }
1840 0, MAXPARA, MFLG_SLOW, 0, NULL,
1841 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1842 - { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore }
1843 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1844 + { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore, mh_uping }
1849 0, MAXPARA, MFLG_SLOW, 0, NULL,
1850 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1851 - { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore }
1852 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1853 + { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore, mh_not_server }
1856 MSG_END_OF_BURST_ACK,
1857 TOK_END_OF_BURST_ACK,
1858 0, MAXPARA, MFLG_SLOW, 0, NULL,
1859 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1860 - { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore }
1861 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1862 + { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore, mh_not_server }
1867 0, MAXPARA, MFLG_SLOW, 0, NULL,
1868 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1869 - { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore }
1870 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1871 + { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore, mh_not_server }
1876 0, MAXPARA, MFLG_SLOW, 0, NULL,
1877 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1878 - { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore }
1879 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1880 + { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore, mh_hash }
1885 0, MAXPARA, MFLG_SLOW, 0, NULL,
1886 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1887 - { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore }
1888 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1889 + { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore, mh_rehash }
1894 0, MAXPARA, MFLG_SLOW, 0, NULL,
1895 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1896 - { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore }
1897 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1898 + { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore, mh_restart }
1903 0, MAXPARA, MFLG_SLOW, 0, NULL,
1904 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1905 - { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore }
1906 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1907 + { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore, mh_die }
1912 0, MAXPARA, MFLG_SLOW, 0, NULL,
1913 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1914 - { m_proto, m_proto, m_proto, m_proto, m_ignore }
1915 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1916 + { m_proto, m_proto, m_proto, m_proto, m_ignore, mh_nohelp }
1921 0, MAXPARA, MFLG_SLOW, 0, NULL,
1922 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1923 - { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore }
1924 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1925 + { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore, mh_set }
1930 0, MAXPARA, MFLG_SLOW, 0, NULL,
1931 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1932 - { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore }
1933 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1934 + { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore, mh_reset }
1939 0, MAXPARA, MFLG_SLOW, 0, NULL,
1940 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1941 - { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore }
1942 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1943 + { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore, mh_get }
1948 0, MAXPARA, MFLG_SLOW, 0, NULL,
1949 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1950 - { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore }
1951 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1952 + { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore, mh_privs }
1957 0, MAXPARA, MFLG_SLOW, 0, NULL,
1958 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1959 - { m_ignore, m_ignore, ms_account, m_ignore, m_ignore }
1960 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1961 + { m_ignore, m_ignore, ms_account, m_ignore, m_ignore, mh_not_server }
1966 0, MAXPARA, MFLG_SLOW, 0, NULL,
1967 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1968 - { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore }
1969 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1970 + { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore, mh_asll }
1975 0, MAXPARA, MFLG_SLOW, 0, NULL,
1976 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1977 - { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore }
1978 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1979 + { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore, mh_sethost }
1981 #if WE_HAVE_A_REAL_CAPABILITY_NOW
1985 0, MAXPARA, 0, 0, NULL,
1986 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1987 - { m_cap, m_cap, m_ignore, m_cap, m_ignore }
1988 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1989 + { m_cap, m_cap, m_ignore, m_cap, m_ignore, mh_nohelp }
1996 0, MAXPARA, MFLG_SLOW, 0, NULL,
1997 - { m_unregistered, m_not_oper, m_check, m_check, m_ignore }
1998 + { m_unregistered, m_not_oper, m_check, m_check, m_ignore, mh_check }
2005 0, MAXPARA, MFLG_SLOW, 0, NULL,
2006 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2007 - { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore }
2008 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2009 + { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore, mh_nohelp }
2012 /* This command is an alias for QUIT during the unregistered part of
2016 0, MAXPARA, MFLG_SLOW, 0, NULL,
2017 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2018 - { m_quit, m_ignore, m_ignore, m_ignore, m_ignore }
2019 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2020 + { m_quit, m_ignore, m_ignore, m_ignore, m_ignore, mh_nohelp }
2024 @@ -779,6 +779,14 @@
2028 +/** Look up a command in the message trie.
2029 + * @param cmd Text of command to look up.
2030 + * @return Pointer to matching message, or NULL if non exists.
2032 +struct Message *find_message_by_cmd(char *cmd) {
2033 + return msg_tree_parse(cmd, &msg_tree);
2036 /** Registers a service mapping to the pseudocommand handler.
2037 * @param[in] map Service mapping to add.
2038 * @return Non-zero on success; zero if a command already used the name.
2040 msg->handlers[SERVER_HANDLER] = m_ignore;
2041 msg->handlers[OPER_HANDLER] = m_pseudo;
2042 msg->handlers[SERVICE_HANDLER] = m_ignore;
2043 + msg->handlers[HELP_HANDLER] = mh_nohelp;
2045 add_msg_element(&msg_tree, msg, msg->cmd);
2047 diff -r 7fa4708bac45 ircd/s_err.c
2048 --- a/ircd/s_err.c Sun Jan 25 12:48:01 2009 +0100
2049 +++ b/ircd/s_err.c Sun Jan 25 23:52:18 2009 +0100
2050 @@ -1230,6 +1230,16 @@
2058 + { RPL_HELP, 0, "601" },
2060 + { RPL_ENDOFHELP, "%s :End of /HELP report.", "602" },
2062 + { ERR_NOHELP, "%s :No help found.", "603" },