ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/chanserv/help.C
Revision: 1.3
Committed: Sat Jul 21 13:23:18 2007 UTC (19 years, 3 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 © 2003-2004 E. Will 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 CService HELP command.
6     *
7 pippijn 1.3 * $Id: help.C,v 1.2 2007-07-21 01:29:08 pippijn Exp $
8 pippijn 1.1 */
9    
10     #include "atheme.h"
11     #include <account/chanacs.h>
12    
13 pippijn 1.3 static char const rcsid[] = "$Id$";
14 pippijn 1.1
15     struct cs_help_listeners : callback::has_listeners
16     {
17     };
18    
19     cs_help_listeners listeners;
20    
21     DECLARE_MODULE_V1 ("chanserv/help", false, _modinit, _moddeinit, rcsid, "The Ermyth Team <http://ermyth.schmorp.de>");
22    
23     static void cs_cmd_help (sourceinfo_t *si, int parc, char *parv[]);
24    
25     command_t cs_help = { "HELP", N_("Displays contextual help information."),
26     AC_NONE, 1, cs_cmd_help
27     };
28    
29     cmdvec *cs_cmdtree;
30     helpvec *cs_helptree;
31    
32     void
33     _modinit (module_t *m)
34     {
35     MODULE_USE_SYMBOL_T (cs_cmdtree, cmdvec, "chanserv/main", "cs_cmdtree");
36     MODULE_USE_SYMBOL_T (cs_helptree, helpvec, "chanserv/main", "cs_helptree");
37    
38     cs_cmdtree << cs_help;
39     help_addentry (cs_helptree, "HELP", "help/help", NULL);
40     }
41    
42     void
43     _moddeinit ()
44     {
45     cs_cmdtree >> cs_help;
46     help_delentry (cs_helptree, "HELP");
47     }
48    
49     /* HELP <command> [params] */
50     static void
51     cs_cmd_help (sourceinfo_t *si, int parc, char *parv[])
52     {
53     char *command = parv[0];
54    
55     /* strip off channel name for fantasy commands */
56     if (si->c)
57     {
58     command = strchr (command, ' ');
59     if (command != NULL)
60     command++;
61     }
62    
63     if (!command)
64     {
65     command_success_nodata (si, _("***** \2%s Help\2 *****"), chansvs.nick);
66     command_success_nodata (si, _("\2%s\2 gives normal users the ability to maintain control"), chansvs.nick);
67     command_success_nodata (si, _("of a channel, without the need of a bot. Channel takeovers are"));
68     command_success_nodata (si, _("virtually impossible when a channel is registered with \2%s\2."), chansvs.nick);
69     command_success_nodata (si, _("Registration is a quick and painless process. Once registered,"));
70     command_success_nodata (si, _("the founder can maintain complete and total control over the channel."));
71     if (chansvs.expiry > 0)
72     {
73     command_success_nodata (si, _("Please note that channels will expire after %d days of inactivity,"), (chansvs.expiry / 86400));
74     command_success_nodata (si, _("or if there are no eligible channel successors."));
75     command_success_nodata (si, _("Activity is defined as a user with one of %s being on the channel."), bitmask_to_flags2 (CA_USEDUPDATE & ca_all, 0, chanacs_flags));
76     }
77     else
78     {
79     command_success_nodata (si, _("Please note that channels will expire if there are no eligible channel successors."));
80     }
81     command_success_nodata (si, _("Successors are primarily those who have the +R flag"));
82     command_success_nodata (si, _("set on their account in the channel, although other"));
83     command_success_nodata (si, _("people may be chosen depending on their access"));
84     command_success_nodata (si, _("level and activity."));
85     command_success_nodata (si, " ");
86     if (chansvs.fantasy && config_options.join_chans && chansvs.trigger != '\0')
87     {
88     command_success_nodata (si, _("Commands can also be given on channel by prefixing one of '%s'"), chansvs.trigger);
89     command_success_nodata (si, _("and omitting the channel name. These are called \"fantasy\""));
90     command_success_nodata (si, _("commands and can also be disabled on a per-channel basis."));
91     command_success_nodata (si, " ");
92     }
93     command_success_nodata (si, _("For more information on a command, type:"));
94     command_success_nodata (si, "\2/%s%s help <command>\2", (ircd->uses_rcommand == false) ? "msg " : "", chansvs.disp);
95     command_success_nodata (si, " ");
96     command_success_nodata (si, _("For a verbose listing of all commands, type:"));
97     command_success_nodata (si, "\2/%s%s help commands\2", (ircd->uses_rcommand == false) ? "msg " : "", chansvs.disp);
98     command_success_nodata (si, " ");
99    
100     command_help_short (si, cs_cmdtree, "REGISTER OP INVITE UNBAN FLAGS RECOVER SET");
101    
102     command_success_nodata (si, _("***** \2End of Help\2 *****"));
103     return;
104     }
105    
106     if (!strcasecmp ("COMMANDS", command))
107     {
108     command_success_nodata (si, _("***** \2%s Help\2 *****"), chansvs.nick);
109     command_help (si, cs_cmdtree);
110     command_success_nodata (si, _("***** \2End of Help\2 *****"));
111     return;
112     }
113    
114     help_display (si, command, cs_helptree);
115     }
116    
117     /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
118     * vim:ts=8
119     * vim:sw=8
120     * vim:noexpandtab
121     */