/** * help.C: This file contains routines to handle the NickServ HELP command. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2005 William Pitcock, et al. * Rights to this code are documented in doc/pod/license.pod. * * $Id: help.C,v 1.7 2007/09/22 14:27:27 pippijn Exp $ */ #include "atheme.h" #include static char const rcsid[] = "$Id: help.C,v 1.7 2007/09/22 14:27:27 pippijn Exp $"; REGISTER_MODULE ("nickserv/help", false, "The Ermyth Team "); E cmdvec ns_cmdtree; E helpvec ns_helptree; static void ns_cmd_help (sourceinfo_t *si, int parc, char *parv[]); command_t const ns_help = { "HELP", N_("Displays contextual help information."), AC_NONE, 1, ns_cmd_help }; bool _modinit (module *m) { ns_cmdtree << ns_help; help_addentry (ns_helptree, "HELP", "help/nickserv/help", NULL); return true; } void _moddeinit () { ns_cmdtree >> ns_help; help_delentry (ns_helptree, "HELP"); } /* HELP [params] */ void ns_cmd_help (sourceinfo_t *si, int parc, char *parv[]) { char *command = parv[0]; if (!command) { command_success_nodata (si, _("***** \2%s Help\2 *****"), nicksvs.nick); if (nicksvs.no_nick_ownership) { command_success_nodata (si, _("\2%s\2 allows users to \2'register'\2 an account for use with"), nicksvs.nick); 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)); command_success_nodata (si, _("\2%s\2 will drop the account, allowing it to be reregistered."), nicksvs.nick); } else { command_success_nodata (si, _("\2%s\2 allows users to \2'register'\2 a nickname, and stop"), nicksvs.nick); command_success_nodata (si, _("others from using that nick. \2%s\2 allows the owner of a"), nicksvs.nick); command_success_nodata (si, _("nickname to disconnect a user from the network that is using"), nicksvs.nick); command_success_nodata (si, _("their nickname. If a registered nick is not used by the owner for %d days,"), (nicksvs.expiry / 86400)); command_success_nodata (si, _("\2%s\2 will drop the nickname, allowing it to be reregistered."), nicksvs.nick); } command_success_nodata (si, " "); command_success_nodata (si, _("For more information on a command, type:")); command_success_nodata (si, "\2/%s%s help \2", (ircd->uses_rcommand == false) ? "msg " : "", nicksvs.disp); command_success_nodata (si, " "); command_help_short (si, ns_cmdtree, "REGISTER IDENTIFY GHOST RELEASE INFO LISTCHANS SET GROUP UNGROUP MARK FREEZE SENDPASS"); command_success_nodata (si, _("***** \2End of Help\2 *****")); return; } if (!strcasecmp ("COMMANDS", command)) { command_success_nodata (si, _("***** \2%s Help\2 *****"), nicksvs.nick); command_help (si, ns_cmdtree); command_success_nodata (si, _("***** \2End of Help\2 *****")); return; } /* take the command through the hash table */ help_display (si, command, ns_helptree); }