ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/nickserv/help.C
Revision: 1.3
Committed: Sat Jul 21 13:23:20 2007 UTC (19 years, 2 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.2: +2 -2 lines
Log Message:
- added rcsid to some files
- more documentation tweaks
- made most protocol commands local to phandler.C
- added ircd metadata (inspircd only for now)
- added inspircd swhois support

File Contents

# User Rev Content
1 pippijn 1.1 /*
2     * Copyright © 2005 William Pitcock, et al.
3 pippijn 1.2 * Rights to this code are documented in doc/pod/license.pod.
4 pippijn 1.1 *
5     * This file contains routines to handle the NickServ HELP command.
6     *
7 pippijn 1.3 * $Id: help.C,v 1.2 2007-07-21 01:29:09 pippijn Exp $
8 pippijn 1.1 */
9    
10     #include "atheme.h"
11    
12 pippijn 1.3 static char const rcsid[] = "$Id$";
13 pippijn 1.1
14     struct ns_help_listeners : callback::has_listeners
15     {
16     };
17    
18     ns_help_listeners listeners;
19    
20     DECLARE_MODULE_V1 ("nickserv/help", false, _modinit, _moddeinit, rcsid, "The Ermyth Team <http://ermyth.schmorp.de>");
21    
22     cmdvec *ns_cmdtree;
23     helpvec *ns_helptree;
24    
25     static void ns_cmd_help (sourceinfo_t *si, int parc, char *parv[]);
26    
27     command_t ns_help = { "HELP", N_("Displays contextual help information."), AC_NONE, 1, ns_cmd_help };
28    
29     void
30     _modinit (module_t *m)
31     {
32     MODULE_USE_SYMBOL_T (ns_cmdtree, cmdvec, "nickserv/main", "ns_cmdtree");
33     MODULE_USE_SYMBOL_T (ns_helptree, helpvec, "nickserv/main", "ns_helptree");
34    
35     ns_cmdtree << ns_help;
36     help_addentry (ns_helptree, "HELP", "help/help", NULL);
37     }
38    
39     void
40     _moddeinit ()
41     {
42     ns_cmdtree >> ns_help;
43     help_delentry (ns_helptree, "HELP");
44     }
45    
46     /* HELP <command> [params] */
47     void
48     ns_cmd_help (sourceinfo_t *si, int parc, char *parv[])
49     {
50     char *command = parv[0];
51    
52     if (!command)
53     {
54     command_success_nodata (si, _("***** \2%s Help\2 *****"), nicksvs.nick);
55     if (nicksvs.no_nick_ownership)
56     {
57     command_success_nodata (si, _("\2%s\2 allows users to \2'register'\2 an account for use with"), nicksvs.nick);
58     command_success_nodata (si, _("\2%s\2. If a registered account is not used by the owner for %d days,"), chansvs.nick, (nicksvs.expiry / 86400));
59     command_success_nodata (si, _("\2%s\2 will drop the account, allowing it to be reregistered."), nicksvs.nick);
60     }
61     else
62     {
63     command_success_nodata (si, _("\2%s\2 allows users to \2'register'\2 a nickname, and stop"), nicksvs.nick);
64     command_success_nodata (si, _("others from using that nick. \2%s\2 allows the owner of a"), nicksvs.nick);
65     command_success_nodata (si, _("nickname to disconnect a user from the network that is using"), nicksvs.nick);
66     command_success_nodata (si, _("their nickname. If a registered nick is not used by the owner for %d days,"), (nicksvs.expiry / 86400));
67     command_success_nodata (si, _("\2%s\2 will drop the nickname, allowing it to be reregistered."), nicksvs.nick);
68     }
69     command_success_nodata (si, " ");
70     command_success_nodata (si, _("For more information on a command, type:"));
71     command_success_nodata (si, "\2/%s%s help <command>\2", (ircd->uses_rcommand == false) ? "msg " : "", nicksvs.disp);
72     command_success_nodata (si, " ");
73    
74     command_help_short (si, ns_cmdtree, "REGISTER IDENTIFY GHOST RELEASE INFO LISTCHANS SET GROUP UNGROUP MARK FREEZE SENDPASS");
75    
76     command_success_nodata (si, _("***** \2End of Help\2 *****"));
77     return;
78     }
79    
80     if (!strcasecmp ("COMMANDS", command))
81     {
82     command_success_nodata (si, _("***** \2%s Help\2 *****"), nicksvs.nick);
83     command_help (si, ns_cmdtree);
84     command_success_nodata (si, _("***** \2End of Help\2 *****"));
85     return;
86     }
87    
88     /* take the command through the hash table */
89     help_display (si, command, ns_helptree);
90     }
91    
92     /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
93     * vim:ts=8
94     * vim:sw=8
95     * vim:noexpandtab
96     */