diff options
author | Sadie Powell <sadie@witchery.services> | 2020-01-15 12:56:41 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-01-15 12:56:41 +0000 |
commit | b0faa27567d7f6e7d10741180a6b3224f75d6e6e (patch) | |
tree | ae54666db1e4927deca7d528ec466c7e8f1739cd | |
parent | c299adb31a9866a50eff7779c7ba513095a79feb (diff) |
Add support for setting the help topic in helpop.
-rw-r--r-- | docs/conf/helpop.conf.example | 682 | ||||
-rw-r--r-- | src/modules/m_helpop.cpp | 36 |
2 files changed, 369 insertions, 349 deletions
diff --git a/docs/conf/helpop.conf.example b/docs/conf/helpop.conf.example index 437f30499..4308c9915 100644 --- a/docs/conf/helpop.conf.example +++ b/docs/conf/helpop.conf.example @@ -3,8 +3,9 @@ # or you can customize the responses for your network and/or add more. # # The way the new helpop system works is simple. You use one or more helpop tags. -# <helpop key="moo" value="something here"> -# key is what the user is looking for (i.e. /helpop moo), and value is what they get back +# <helpop key="moo" title="something here" value="something here"> +# key is what the user is looking for (i.e. /helpop moo), title is the title, and +# value is what they get back # (note that it can span multiple lines!). # -- w00t 16/dec/2006 # @@ -15,8 +16,7 @@ <helpmsg nohelp="There is no help for the topic you searched for. Please try again."> -<helpop key="start" value="InspIRCd Help System - +<helpop key="start" title="InspIRCd Help System" value=" This system provides help for commands and modes. Specify your question or a command name as the parameter for this command. @@ -26,11 +26,11 @@ parameter for this command. /HELPOP UMODES - To see a list of user modes /HELPOP CHMODES - To see a list of channel modes /HELPOP SNOMASKS - To see a list of oper snotice masks -/HELPOP EXTBANS - To see a list of extended bans"> - -<helpop key="cuser" value="User Commands -------------- +/HELPOP EXTBANS - To see a list of extended bans +/HELPOP INDEX - To see a list of help topics +"> +<helpop key="cuser" title="User Commands" value=" ACCEPT ADMIN AWAY COMMANDS CYCLE DCCALLOW FPART INFO INVITE ISON JOIN KICK KNOCK LINKS LIST LUSERS MAP MKPASSWD @@ -39,32 +39,32 @@ NOTICE OPER PART PASS PING PONG PRIVMSG QUIT REMOVE SETNAME SILENCE SQUERY SSLINFO STATS TBAN TIME TITLE TOPIC UNINVITE USER USERHOST VERSION VHOST WATCH -WHO WHOIS WHOWAS"> - -<helpop key="squery" value="/SQUERY <target> :<message> - -Sends a message to the network service specified in <target>."> +WHO WHOIS WHOWAS +"> -<helpop key="sslinfo" value="/SSLINFO <nick> +<helpop key="squery" title="/SQUERY <target> :<message>" value=" +Sends a message to the network service specified in <target>. +"> +<helpop key="sslinfo" title="/SSLINFO <nick>" value=" Displays information on the SSL connection and certificate of the -target user."> - -<helpop key="uninvite" value="/UNINVITE <nick> <channel> - -Uninvite a user from a channel, same syntax as INVITE."> +target user. +"> -<helpop key="tban" value="/TBAN <channel> <duration> <banmask> +<helpop key="uninvite" title="/UNINVITE <nick> <channel>" value=" +Uninvite a user from a channel, same syntax as INVITE. +"> +<helpop key="tban" title="/TBAN <channel> <duration> <banmask>" value=" Sets a timed ban. The duration of the ban can be specified in the form of 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, five minutes and six seconds. All fields in this format are optional. Alternatively, the ban may just be specified as a number of seconds. All timed bans appear in the banlist as -normal bans and may be safely removed before their time is up."> - -<helpop key="dccallow" value="/DCCALLOW [(+|-)<nick> [<time>]]|[LIST|HELP] +normal bans and may be safely removed before their time is up. +"> +<helpop key="dccallow" title="/DCCALLOW [(+|-)<nick> [<time>]]|[LIST|HELP]" value=" /DCCALLOW - List allowed nicks /DCCALLOW LIST - This also lists allowed nicks /DCCALLOW +<nick> [<duration>] - Add a nick @@ -74,10 +74,10 @@ normal bans and may be safely removed before their time is up."> Duration is optional, and may be specified in seconds or in the form of 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, five minutes and six seconds. All fields in this -format are optional."> - -<helpop key="accept" value="/ACCEPT *|(+|-)<nick>[,(+|-)<nick>]+ +format are optional. +"> +<helpop key="accept" title="/ACCEPT *|(+|-)<nick>[,(+|-)<nick>]+" value=" Manages your accept list. This list is used to determine who can private message you when you have user mode +g set. @@ -86,20 +86,20 @@ private message you when you have user mode +g set. /ACCEPT -<nick> - Remove a nick This command accepts multiple nicks like so: -/ACCEPT +<nick>,-<nick>,+<nick>"> - -<helpop key="cycle" value="/CYCLE <channel> [:<reason>] +/ACCEPT +<nick>,-<nick>,+<nick> +"> +<helpop key="cycle" title="/CYCLE <channel> [:<reason>]" value=" Cycles a channel (leaving and rejoining), overrides restrictions that -would stop a new user joining, such as user limits and channel keys."> - -<helpop key="title" value="/TITLE <username> <password> +would stop a new user joining, such as user limits and channel keys. +"> +<helpop key="title" title="/TITLE <username> <password>" value=" Authenticate for a WHOIS title line and optionally a vhost using the -specified username and password."> - -<helpop key="watch" value="/WATCH C|L|l|S|(+|-)<nick> [(+|-)<nick>]+ +specified username and password. +"> +<helpop key="watch" title="/WATCH C|L|l|S|(+|-)<nick> [(+|-)<nick>]+" value=" /WATCH - List watched nicks that are online /WATCH l - List watched nicks that are online /WATCH L - List watched nicks, online and offline @@ -109,10 +109,10 @@ specified username and password."> /WATCH -<nick> - Remove a nick This command accepts multiple nicks like so: -/WATCH +<nick> -<nick> +<nick>"> - -<helpop key="monitor" value="/MONITOR C|L|S|(+|-) <nick>[,<nick>]+ +/WATCH +<nick> -<nick> +<nick> +"> +<helpop key="monitor" title="/MONITOR C|L|S|(+|-) <nick>[,<nick>]+" value=" /MONITOR L - List all monitored nicks, not differentiating between online and offline nicks /MONITOR C - Clear all monitored nicks @@ -123,30 +123,30 @@ This command accepts multiple nicks like so: This command accepts multiple nicks like so: /MONITOR + <nick>,<nick>,<nick> -/MONITOR - <nick>,<nick>,<nick>"> - -<helpop key="vhost" value="/VHOST <username> <password> - -Authenticate for a vhost using the specified username and password."> +/MONITOR - <nick>,<nick>,<nick> +"> -<helpop key="remove" value="/REMOVE <channel> <nick> [:<reason>] +<helpop key="vhost" title="/VHOST <username> <password>" value=" +Authenticate for a vhost using the specified username and password. +"> +<helpop key="remove" title="/REMOVE <channel> <nick> [:<reason>]" value=" Removes a user from a channel you specify. You must be at least a channel halfoperator to remove a user. A removed user will part with -a message stating they were removed from the channel and by whom."> - -<helpop key="rmode" value="/RMODE <channel> <mode> [<pattern>] +a message stating they were removed from the channel and by whom. +"> +<helpop key="rmode" title="/RMODE <channel> <mode> [<pattern>]" value=" Removes listmodes from a channel, optionally matching a glob-based pattern. -E.g. '/RMODE #channel b m:*' will remove all mute extbans on the channel."> - -<helpop key="fpart" value="/FPART <channel> <nick> [:<reason>] +E.g. '/RMODE #channel b m:*' will remove all mute extbans on the channel. +"> +<helpop key="fpart" title="/FPART <channel> <nick> [:<reason>]" value=" This behaves identically to /REMOVE. /REMOVE is a built-in mIRC command -which caused trouble for some users."> - -<helpop key="silence" value="/SILENCE [(+|-)<mask> [CcdiNnPpTtx]] +which caused trouble for some users. +"> +<helpop key="silence" title="/SILENCE [(+|-)<mask> [CcdiNnPpTtx]]" value=" A server-side ignore of the given n!u@h mask. If the optional flags field is specified then it must contain one or more flags which specify what kind of messages should be blocked and how they should be blocked. @@ -169,72 +169,72 @@ Valid SILENCE Flags t Matches a TAGMSG targeted at a channel. x Exempt the mask from silence rules. -Any combination of flags is valid."> - -<helpop key="knock" value="/KNOCK <channel> :<reason> - -Sends a notice to a channel indicating you wish to join."> +Any combination of flags is valid. +"> -<helpop key="user" value="/USER <username> <unused> <unused> :<realname> +<helpop key="knock" title="/KNOCK <channel> :<reason>" value=" +Sends a notice to a channel indicating you wish to join. +"> +<helpop key="user" title="/USER <username> <unused> <unused> :<realname>" value=" This command is used by your client to register your IRC session, providing your ident and real name to the server. -You should not use it during an established connection."> - -<helpop key="nick" value="/NICK <newnick> - -Change your nickname to <newnick>."> - -<helpop key="quit" value="/QUIT [:<message>] - -Quit from IRC and end your current session."> - -<helpop key="version" value="/VERSION [<servername>] +You should not use it during an established connection. +"> -Returns the server's version information."> +<helpop key="nick" title="/NICK <newnick>" value=" +Change your nickname to <newnick>. +"> -<helpop key="ping" value="/PING <servername> [:<servername>] +<helpop key="quit" title="/QUIT [:<message>]" value=" +Quit from IRC and end your current session. +"> -Ping a server. The server will answer with a PONG."> +<helpop key="version" title="/VERSION [<servername>]" value=" +Returns the server's version information. +"> -<helpop key="pong" value="/PONG <servername> +<helpop key="ping" title="/PING <servername> [:<servername>]" value=" +Ping a server. The server will answer with a PONG. +"> +<helpop key="pong" title="/PONG <servername>" value=" Your client should send this to answer server PINGs. You -should not issue this command manually."> - -<helpop key="admin" value="/ADMIN [<servername>] - -Shows the administrative information for the given server."> - -<helpop key="privmsg" value="/PRIVMSG <target>[,<target>]+ :<message> - -Sends a message to a user or channel specified in <target>."> - -<helpop key="notice" value="/NOTICE <target>[,<target>]+ :<message> - -Sends a notice to a user or channel specified in <target>."> - -<helpop key="join" value="/JOIN <channel>[,<channel>]+ [<key>[,<key>]+] +should not issue this command manually. +"> -Joins one or more channels you provide the names for."> +<helpop key="admin" title="/ADMIN [<servername>]" value=" +Shows the administrative information for the given server. +"> -<helpop key="names" value="/NAMES [<channel>[,<channel>]+] +<helpop key="privmsg" title="/PRIVMSG <target>[,<target>]+ :<message>" value=" +Sends a message to a user or channel specified in <target>. +"> -Return a list of users on the channel(s) you provide."> +<helpop key="notice" title="/NOTICE <target>[,<target>]+ :<message>" value=" +Sends a notice to a user or channel specified in <target>. +"> -<helpop key="part" value="/PART <channel>[,<channel>]+ [:<reason>] +<helpop key="join" title="/JOIN <channel>[,<channel>]+ [<key>[,<key>]+]" value=" +Joins one or more channels you provide the names for. +"> -Leaves one or more channels you specify."> +<helpop key="names" title="/NAMES [<channel>[,<channel>]+]" value=" +Return a list of users on the channel(s) you provide. +"> -<helpop key="kick" value="/KICK <channel> <nick>[,<nick>]+ [:<reason>] +<helpop key="part" title="/PART <channel>[,<channel>]+ [:<reason>]" value=" +Leaves one or more channels you specify. +"> +<helpop key="kick" title="/KICK <channel> <nick>[,<nick>]+ [:<reason>]" value=" Kicks a user from a channel you specify. You must be -at least a channel halfoperator to kick a user."> - -<helpop key="mode" value="/MODE <target> [[(+|-)]<modes> [<mode-parameters>]] +at least a channel halfoperator to kick a user. +"> +<helpop key="mode" title="/MODE <target> [[(+|-)]<modes> [<mode-parameters>]]" value=" Change or view modes of <target>. /MODE <target> - Show modes of <target>. @@ -247,17 +247,17 @@ A user may only set modes upon themselves, and may not set the channels where they are at least a halfoperator. For a list of all user and channel modes, enter /HELPOP UMODES or -/HELPOP CHMODES."> - -<helpop key="topic" value="/TOPIC <channel> [:<topic>] +/HELPOP CHMODES. +"> +<helpop key="topic" title="/TOPIC <channel> [:<topic>]" value=" Sets or retrieves the channel topic. If a channel topic is given in the command and either the channel is not +t, or you are at least a halfoperator, the channel topic will be -changed to the new one you provide."> - -<helpop key="who" value="/WHO <pattern> [<flags>][%[<fields>[,<querytype>]]] <pattern> +changed to the new one you provide. +"> +<helpop key="who" title="/WHO <pattern> [<flags>][%[<fields>[,<querytype>]]] <pattern>" value=" Looks up information about users matching the provided pattern. You can specify a flag specific pattern, a channel name, user hostname, a user server name, a user real name, or a user nickname. Matching users will only be included in the @@ -333,47 +333,47 @@ Valid WHO Fields t Include the query type in the response. u Include the user's ident in the response. -"> -<helpop key="motd" value="/MOTD [<servername>] +"> +<helpop key="motd" title="/MOTD [<servername>]" value=" Show the message of the day for <server>. Messages of the day often contain important server rules and notices and should be read prior -to using a server."> - -<helpop key="oper" value="/OPER <username> <password> +to using a server. +"> +<helpop key="oper" title="/OPER <username> <password>" value=" Attempts to authenticate as a server operator. Both successful and unsuccessful oper attempts are -logged, and sent to online server operators."> - -<helpop key="list" value="/LIST [<pattern>] +logged, and sent to online server operators. +"> +<helpop key="list" title="/LIST [<pattern>]" value=" Creates a list of all existing channels matching the glob pattern -<pattern>, e.g. *chat* or bot*."> - -<helpop key="lusers" value="/LUSERS - -Shows a count of local and remote users, servers and channels."> +<pattern>, e.g. *chat* or bot*. +"> -<helpop key="userhost" value="/USERHOST <nick> [<nick>]+ +<helpop key="lusers" title="/LUSERS" value=" +Shows a count of local and remote users, servers and channels. +"> +<helpop key="userhost" title="/USERHOST <nick> [<nick>]+" value=" Returns the hostname and nickname of a user, and some other -miscellaneous information."> - -<helpop key="away" value="/AWAY [:<message>] +miscellaneous information. +"> +<helpop key="away" title="/AWAY [:<message>]" value=" If a message is given, marks you as being away, otherwise -removes your away status and previous message."> - -<helpop key="ison" value="/ISON <nick> [<nick>]+ +removes your away status and previous message. +"> +<helpop key="ison" title="/ISON <nick> [<nick>]+" value=" Returns a subset of the nicks you give, showing only those -that are currently online."> - -<helpop key="invite" value="/INVITE [<nick> <channel> [<time>]] +that are currently online. +"> +<helpop key="invite" title="/INVITE [<nick> <channel> [<time>]]" value=" Invites a user to a channel. If the channel is NOT +A, only channel halfoperators or above can invite people. If +A is set, anyone can invite people to the channel, as long as the person @@ -391,56 +391,55 @@ are optional. Alternatively, the time may just be specified as a number of seconds. /INVITE without a parameter will list pending invitations for channels -you have been invited to."> - -<helpop key="pass" value="/PASS <password> +you have been invited to. +"> +<helpop key="pass" title="/PASS <password>" value=" This command is used by your client when setting up your IRC session to submit a server password to the server. -You should not use it during an established connection."> - -<helpop key="whowas" value="/WHOWAS <nick> +You should not use it during an established connection. +"> +<helpop key="whowas" title="/WHOWAS <nick>" value=" Returns a list of times the user was seen recently on IRC along with -the time they were last seen and their server."> - -<helpop key="links" value="/LINKS - -Shows all linked servers."> +the time they were last seen and their server. +"> -<helpop key="map" value="/MAP +<helpop key="links" title="/LINKS" value=" +Shows all linked servers. +"> +<helpop key="map" title="/MAP" value=" Shows a graphical representation of all users and servers on the network, and the links between them, as a tree from the perspective -of your server."> - -<helpop key="whois" value="/WHOIS [<servername>] <nick>[,<nick>]+ +of your server. +"> +<helpop key="whois" title="/WHOIS [<servername>] <nick>[,<nick>]+" value=" Returns the WHOIS information of a user, their channels, hostname, etc. If a servername is provided, then a whois is performed from the server where the user is actually located rather than locally, -showing idle and signon times."> - -<helpop key="time" value="/TIME [<servername>] +showing idle and signon times. +"> +<helpop key="time" title="/TIME [<servername>]" value=" Returns the local time of the server, or remote time of another -server."> - -<helpop key="info" value="/INFO [<servername>] +server. +"> +<helpop key="info" title="/INFO [<servername>]" value=" Returns information on the developers and supporters who made this -IRC server possible."> - -<helpop key="setname" value="/SETNAME :<realname> - -Sets your real name to the specified real name."> +IRC server possible. +"> +<helpop key="setname" title="/SETNAME :<realname>" value=" +Sets your real name to the specified real name. +"> -<helpop key="coper" value="Oper Commands -------------- +<helpop key="coper" title="Oper Commands" value=" ALLTIME CBAN CHECK CHGHOST CHGIDENT CHGNAME CLEARCHAN CLOAK CLONES CONNECT DIE ELINE FILTER GLINE GLOADMODULE @@ -451,30 +450,30 @@ RELOADMODULE RESTART RLINE RSQUIT SAJOIN SAKICK SAMODE SANICK SAPART SAQUIT SATOPIC SETHOST SETIDENT SETIDLE SHUN SQUIT SWHOIS TLINE UNLOADMODULE UNLOCKSERV -USERIP WALLOPS ZLINE"> - -<helpop key="userip" value="/USERIP <nick> [<nick>]+ - -Returns the IP address and nickname of the given user(s)."> +USERIP WALLOPS ZLINE +"> -<helpop key="tline" value="/TLINE <mask> +<helpop key="userip" title="/USERIP <nick> [<nick>]+" value=" +Returns the IP address and nickname of the given user(s). +"> +<helpop key="tline" title="/TLINE <mask>" value=" This command returns the number of local and global clients matched, and the percentage of clients matched, plus how they were matched (by IP address or by hostname). Mask should be given as either -nick!user@host or user@IP (wildcards and CIDR blocks are accepted)."> - -<helpop key="lockserv" value="/LOCKSERV [:<message>] +nick!user@host or user@IP (wildcards and CIDR blocks are accepted). +"> +<helpop key="lockserv" title="/LOCKSERV [:<message>]" value=" Locks out all new connections notifying connecting users that the -service is temporarily closed and to try again later."> - -<helpop key="unlockserv" value="/UNLOCKSERV - -Opens the server up again for new connections."> +service is temporarily closed and to try again later. +"> -<helpop key="filter" value="/FILTER <pattern> [<action> <flags> [<duration>] :<reason>] +<helpop key="unlockserv" title="/UNLOCKSERV" value=" +Opens the server up again for new connections. +"> +<helpop key="filter" title="/FILTER <pattern> [<action> <flags> [<duration>] :<reason>]" value=" This command will add a global filter when more than one parameter is given, for messages of the types specified by the flags, with the given filter pattern, action, duration (when the action is 'gline', 'zline' @@ -523,22 +522,22 @@ minutes and 6 seconds. All fields in this format are optional. When only one parameter is provided (the filter pattern) the provided filter will be removed. Note that if you remove a configuration-defined filter, it will reappear at next rehash unless -it is also removed from the config file."> - -<helpop key="ojoin" value="/OJOIN <channel> +it is also removed from the config file. +"> +<helpop key="ojoin" title="/OJOIN <channel>" value=" Force joins you to the specified channel, and gives you +Y and any other configuration-defined modes on it, preventing you from being kicked. Depending on configuration, may announce that you have joined the -channel on official network business."> - -<helpop key="clones" value="/CLONES <limit> +channel on official network business. +"> +<helpop key="clones" title="/CLONES <limit>" value=" Retrieves a list of users with more clones than the specified -limit."> - -<helpop key="check" value="/CHECK <nick>|<ipmask>|<hostmask>|<channel> [<servername>] +limit. +"> +<helpop key="check" title="/CHECK <nick>|<ipmask>|<hostmask>|<channel> [<servername>]" value=" Allows opers to look up advanced information on nicknames, IP addresses, hostmasks or channels, in a similar way to WHO but in more detail, displaying most information the server has stored on the target, @@ -546,234 +545,234 @@ including all metadata. With the second parameter given, runs the command remotely on the specified server, useful especially if used on a nickname that is -online on a remote server."> - -<helpop key="alltime" value="/ALLTIME - -Shows the date and time of all servers on the network."> +online on a remote server. +"> -<helpop key="rconnect" value="/RCONNECT <remote-server-mask> <target-server-mask> +<helpop key="alltime" title="/ALLTIME" value=" +Shows the date and time of all servers on the network. +"> +<helpop key="rconnect" title="/RCONNECT <remote-server-mask> <target-server-mask>" value=" The server matching <remote-server-mask> will try to connect to the first -server in the config file matching <target-server-mask>."> - -<helpop key="rsquit" value="/RSQUIT <target-server-mask> [:<reason>] +server in the config file matching <target-server-mask>. +"> +<helpop key="rsquit" title="/RSQUIT <target-server-mask> [:<reason>]" value=" Causes a remote server matching <target-server-mask> to be disconnected from -the network."> - -<helpop key="globops" value="/GLOBOPS :<message> - -Sends a message to all users with the +g snomask."> +the network. +"> -<helpop key="cban" value="/CBAN <channel> [<duration> [:<reason>]] +<helpop key="globops" title="/GLOBOPS :<message>" value=" +Sends a message to all users with the +g snomask. +"> +<helpop key="cban" title="/CBAN <channel> [<duration> [:<reason>]]" value=" Sets or removes a global channel ban. You must specify all three parameters to add a ban, and one parameter to remove a ban (just the channel). The duration may be specified in seconds, or in the format 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, -five minutes and six seconds. All fields in this format are optional."> - -<helpop key="sajoin" value="/SAJOIN [<nick>] <channel>[,<channel>]+ +five minutes and six seconds. All fields in this format are optional. +"> +<helpop key="sajoin" title="/SAJOIN [<nick>] <channel>[,<channel>]+" value=" Forces the user to join the channel(s). -If no nick is given, it joins the oper doing the /SAJOIN."> - -<helpop key="sapart" value="/SAPART <nick> <channel>[,<channel>]+ [:<reason>] - -Forces the user to part the channel(s), with an optional reason."> - -<helpop key="samode" value="/SAMODE <target> (+|-)<modes> [<mode-parameters>] - -Applies the given mode change to the channel or nick specified."> - -<helpop key="sanick" value="/SANICK <nick> <newnick> - -Changes the user's nick to the new nick."> - -<helpop key="sakick" value="/SAKICK <channel> <nick> [:<reason>] +If no nick is given, it joins the oper doing the /SAJOIN. +"> -Kicks the given user from the specified channel, with an optional reason."> +<helpop key="sapart" title="/SAPART <nick> <channel>[,<channel>]+ [:<reason>]" value=" +Forces the user to part the channel(s), with an optional reason. +"> -<helpop key="satopic" value="/SATOPIC <channel> :<topic> +<helpop key="samode" title="/SAMODE <target> (+|-)<modes> [<mode-parameters>]" value=" +Applies the given mode change to the channel or nick specified. +"> -Applies the given topic to the specified channel."> +<helpop key="sanick" title="/SANICK <nick> <newnick>" value=" +Changes the user's nick to the new nick. +"> -<helpop key="saquit" value="/SAQUIT <nick> :<reason> +<helpop key="sakick" title="/SAKICK <channel> <nick> [:<reason>]" value=" +Kicks the given user from the specified channel, with an optional reason. +"> -Forces user to quit with the specified reason."> +<helpop key="satopic" title="/SATOPIC <channel> :<topic>" value=" +Applies the given topic to the specified channel. +"> -<helpop key="setidle" value="/SETIDLE <duration> +<helpop key="saquit" title="/SAQUIT <nick> :<reason>" value=" +Forces user to quit with the specified reason. +"> +<helpop key="setidle" title="/SETIDLE <duration>" value=" Sets your idle time to the specified value. The time can be specified in the form of 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, five minutes and six seconds. All fields in this format are optional. Alternatively, the time may -just be specified as a number of seconds."> - -<helpop key="sethost" value="/SETHOST <host> - -Sets your host to the specified host."> - -<helpop key="setident" value="/SETIDENT <ident> +just be specified as a number of seconds. +"> -Sets your ident to the specified ident."> +<helpop key="sethost" title="/SETHOST <host>" value=" +Sets your host to the specified host. +"> -<helpop key="swhois" value="/SWHOIS <nick> :<swhois> +<helpop key="setident" title="/SETIDENT <ident>" value=" +Sets your ident to the specified ident. +"> +<helpop key="swhois" title="/SWHOIS <nick> :<swhois>" value=" Sets the user's swhois field to the given swhois message. This will be visible in their /WHOIS. To remove this message again, use: -/SWHOIS <nick> :"> - -<helpop key="mkpasswd" value="/MKPASSWD <hashtype> <plaintext> +/SWHOIS <nick> : +"> +<helpop key="mkpasswd" title="/MKPASSWD <hashtype> <plaintext>" value=" Encodes the plaintext to a hash of the given type and displays -the result."> - -<helpop key="opermotd" value="/OPERMOTD [<servername>] - -Displays the Oper MOTD."> +the result. +"> -<helpop key="nicklock" value="/NICKLOCK <nick> <newnick> +<helpop key="opermotd" title="/OPERMOTD [<servername>]" value=" +Displays the Oper MOTD. +"> +<helpop key="nicklock" title="/NICKLOCK <nick> <newnick>" value=" Changes the user's nick to the new nick, and forces -it to remain as such for the remainder of the session."> - -<helpop key="nickunlock" value="/NICKUNLOCK <nick> - -Allows a previously locked user to change nicks again."> - -<helpop key="chghost" value="/CHGHOST <nick> <host> - -Changes the host of the user to the specified host."> - -<helpop key="chgname" value="/CHGNAME <nick> :<realname> +it to remain as such for the remainder of the session. +"> -Changes the real name of the user to the specified real name."> +<helpop key="nickunlock" title="/NICKUNLOCK <nick>" value=" +Allows a previously locked user to change nicks again. +"> -<helpop key="chgident" value="/CHGIDENT <nick> <ident> +<helpop key="chghost" title="/CHGHOST <nick> <host>" value=" +Changes the host of the user to the specified host. +"> -Changes the ident of the user to the specified ident."> +<helpop key="chgname" title="/CHGNAME <nick> :<realname>" value=" +Changes the real name of the user to the specified real name. +"> -<helpop key="shun" value="/SHUN <nick!user@host> [<duration> :<reason>] +<helpop key="chgident" title="/CHGIDENT <nick> <ident>" value=" +Changes the ident of the user to the specified ident. +"> +<helpop key="shun" title="/SHUN <nick!user@host> [<duration> :<reason>]" value=" Sets or removes a shun (global server-side ignore) on a nick!user@host mask. You must specify all three parameters to add a shun, and one parameter to remove a shun (just the nick!user@host). The duration may be specified in seconds, or in the format 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, -five minutes and six seconds. All fields in this format are optional."> - -<helpop key="die" value="/DIE <servername> +five minutes and six seconds. All fields in this format are optional. +"> +<helpop key="die" title="/DIE <servername>" value=" This command shuts down the local server. A single parameter is -required, which must match the name of the local server."> - -<helpop key="restart" value="/RESTART <servername> +required, which must match the name of the local server. +"> +<helpop key="restart" title="/RESTART <servername>" value=" This command restarts the local server. A single parameter is -required, which must match the name of the local server."> - -<helpop key="commands" value="/COMMANDS - -Shows all currently available commands."> - -<helpop key="kill" value="/KILL <nick>[,<nick>]+ :<reason> +required, which must match the name of the local server. +"> -This command will disconnect a user from IRC with the given reason."> +<helpop key="commands" title="/COMMANDS" value=" +Shows all currently available commands. +"> -<helpop key="rehash" value="/REHASH [<servermask>] +<helpop key="kill" title="/KILL <nick>[,<nick>]+ :<reason>" value=" +This command will disconnect a user from IRC with the given reason. +"> +<helpop key="rehash" title="/REHASH [<servermask>]" value=" This command will cause the server configuration file to be reread and values reinitialized for all servers matching the server mask, or the -local server if one is not specified."> - -<helpop key="connect" value="/CONNECT <servermask> +local server if one is not specified. +"> +<helpop key="connect" title="/CONNECT <servermask>" value=" Add a connection to the server matching the given server mask. You must have configured the server for linking in your configuration file -before trying to link them."> - -<helpop key="squit" value="/SQUIT <servermask> - -Disconnects the server matching the given server mask from this server."> +before trying to link them. +"> -<helpop key="modules" value="/MODULES [<servername>] +<helpop key="squit" title="/SQUIT <servermask>" value=" +Disconnects the server matching the given server mask from this server. +"> +<helpop key="modules" title="/MODULES [<servername>]" value=" Lists currently loaded modules, their memory offsets, version numbers, -and flags. If you are not an operator, you will see reduced detail."> - -<helpop key="loadmodule" value="/LOADMODULE <modulename> - -Loads the specified module into the local server."> - -<helpop key="unloadmodule" value="/UNLOADMODULE <modulename> - -Unloads a module from the local server."> - -<helpop key="reloadmodule" value="/RELOADMODULE <modulename> - -Unloads and reloads a module on the local server."> - -<helpop key="gloadmodule" value="/GLOADMODULE <modulename> [<servermask>] +and flags. If you are not an operator, you will see reduced detail. +"> -Loads the specified module on all linked servers."> +<helpop key="loadmodule" title="/LOADMODULE <modulename>" value=" +Loads the specified module into the local server. +"> -<helpop key="gunloadmodule" value="/GUNLOADMODULE <modulename> [<servermask>] +<helpop key="unloadmodule" title="/UNLOADMODULE <modulename>" value=" +Unloads a module from the local server. +"> -Unloads a module from all linked servers."> +<helpop key="reloadmodule" title="/RELOADMODULE <modulename>" value=" +Unloads and reloads a module on the local server. +"> -<helpop key="greloadmodule" value="/GRELOADMODULE <modulename> [<servermask>] +<helpop key="gloadmodule" title="/GLOADMODULE <modulename> [<servermask>]" value=" +Loads the specified module on all linked servers. +"> -Unloads and reloads a module on all linked servers."> +<helpop key="gunloadmodule" title="/GUNLOADMODULE <modulename> [<servermask>]" value=" +Unloads a module from all linked servers. +"> -<helpop key="kline" value="/KLINE <user@host> [<duration> :<reason>] +<helpop key="greloadmodule" title="/GRELOADMODULE <modulename> [<servermask>]" value=" +Unloads and reloads a module on all linked servers. +"> +<helpop key="kline" title="/KLINE <user@host> [<duration> :<reason>]" value=" Sets or removes a K-line (local user@host based ban) on a user@host mask. You must specify all three parameters to add a ban, and one parameter to remove a ban (just the user@host). The duration may be specified in seconds, or in the format 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, -five minutes and six seconds. All fields in this format are optional."> - -<helpop key="zline" value="/ZLINE <ipmask> [<duration> :<reason>] +five minutes and six seconds. All fields in this format are optional. +"> +<helpop key="zline" title="/ZLINE <ipmask> [<duration> :<reason>]" value=" Sets or removes a Z-line (global IP based ban) on an IP mask. You must specify all three parameters to add a ban, and one parameter to remove a ban (just the ipmask). The duration may be specified in seconds, or in the format 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, -five minutes and six seconds. All fields in this format are optional."> - -<helpop key="qline" value="/QLINE <nickmask> [<duration> :<reason>] +five minutes and six seconds. All fields in this format are optional. +"> +<helpop key="qline" title="/QLINE <nickmask> [<duration> :<reason>]" value=" Sets or removes a Q-line (global nick based ban) on a nick mask. You must specify all three parameters to add a ban, and one parameter to remove a ban (just the nickmask). The duration may be specified in seconds, or in the format 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, -five minutes and six seconds. All fields in this format are optional."> - -<helpop key="gline" value="/GLINE <user@host> [<duration> :<reason>] +five minutes and six seconds. All fields in this format are optional. +"> +<helpop key="gline" title="/GLINE <user@host> [<duration> :<reason>]" value=" Sets or removes a G-line (global user@host based ban) on a user@host mask. You must specify all three parameters to add a ban, and one parameter to remove a ban (just the user@host). The duration may be specified in seconds, or in the format 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, -five minutes and six seconds. All fields in this format are optional."> - -<helpop key="eline" value="/ELINE <user@host> [<duration> :<reason>] +five minutes and six seconds. All fields in this format are optional. +"> +<helpop key="eline" title="/ELINE <user@host> [<duration> :<reason>]" value=" Sets or removes a E-line (global user@host ban exception) on a user@host mask. You must specify at least 3 parameters to add an exception, and one parameter to remove an exception (just the user@host). @@ -785,47 +784,46 @@ five minutes and six seconds. All fields in this format are optional. This command has a few important limitations. Bans on *@<ip> can only be negated by an E-line on *@<ip>, bans on *@<host> can be negated by E-lines on *@<ip>, or *@<host>, and bans on <ident>@* or <ident>@<host> -can be negated by any E-line that matches."> - -<helpop key="wallops" value="/WALLOPS :<message> - -Sends a message to all +w users."> +can be negated by any E-line that matches. +"> -<helpop key="rline" value="/RLINE <regex> [<duration> :<reason>] +<helpop key="wallops" title="/WALLOPS :<message>" value=" +Sends a message to all +w users. +"> +<helpop key="rline" title="/RLINE <regex> [<duration> :<reason>]" value=" Sets or removes an R-line (global regex ban) on a n!u@h\srealname mask. You must specify all three parameters to add an R-line, and one parameter to remove an R-line (just the regex). The duration may be specified in seconds, or in the format 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, -five minutes and six seconds. All fields in this format are optional."> - -<helpop key="clearchan" value="/CLEARCHAN <channel> [KILL|KICK|G|Z] [:<reason>] +five minutes and six seconds. All fields in this format are optional. +"> +<helpop key="clearchan" title="/CLEARCHAN <channel> [KILL|KICK|G|Z] [:<reason>]" value=" Quits or kicks all non-opers from a channel, optionally G/Z-lines them. Useful for quickly nuking bot channels. The default method, KILL, simply disconnects the victims from the server, while methods G and Z also add G/Z-lines for all the targets. -When used, the victims won't see each other getting kicked or quitting."> - -<helpop key="modenotice" value="/MODENOTICE <modeletters> :<message> +When used, the victims won't see each other getting kicked or quitting. +"> +<helpop key="modenotice" title="/MODENOTICE <modeletters> :<message>" value=" Sends a notice to all users who have the given mode(s) set. If multiple mode letters are given, the notice is only sent to users -who have all of them set."> - -<helpop key="cloak" value="/CLOAK <host> +who have all of them set. +"> +<helpop key="cloak" title="/CLOAK <host>" value=" Generate the cloak of a host or IP. This is useful for example when trying to get the cloak of a user from /WHOWAS and they were not -using their cloak when they quit."> - -<helpop key="umodes" value="User Modes ----------- +using their cloak when they quit. +"> +<helpop key="umodes" title="User Modes" value=" c Blocks private messages and notices from users who do not share a common channel with you (requires the commonchans module). @@ -867,11 +865,10 @@ using their cloak when they quit."> S Strips formatting codes out of private messages to the user (requires the stripcolor module). W Receives notifications when a user uses WHOIS on them - (server operators only, requires the showwhois module)."> - -<helpop key="chmodes" value="Channel Modes -------------- + (server operators only, requires the showwhois module). +"> +<helpop key="chmodes" title="Channel Modes" value=" v <nickname> Gives voice to <nickname>, allowing them to speak while the channel is +m. h <nickname> Gives halfop status to <nickname> (requires the @@ -1004,14 +1001,13 @@ using their cloak when they quit."> stripcolor Channel mode +S topiclock Channel mode +t -------------- NOTE: A large number of these modes are dependent upon server-side modules being loaded by a server/network administrator. The actual modes available on your network may be very different to this list. Please consult your -help channel if you have any questions."> - -<helpop key="stats" value="/STATS <symbol> [<servername>] +help channel if you have any questions. +"> +<helpop key="stats" title="/STATS <symbol> [<servername>]" value=" Shows various server statistics. Depending on configuration, some symbols may be only available to opers. @@ -1047,10 +1043,10 @@ E Show socket engine events S Show currently held registered nicknames G Show how many local users are connected from each country -Note that all /STATS use is broadcast to online server operators."> - -<helpop key="snomasks" value="Server Notice Masks +Note that all /STATS use is broadcast to online server operators. +"> +<helpop key="snomasks" title="Server Notice Masks" value=" a Allows receipt of local announcement messages. A Allows receipt of remote announcement messages. c Allows receipt of local connect messages. @@ -1077,11 +1073,10 @@ Note that all /STATS use is broadcast to online server operators."> t Allows receipt of attempts to use /STATS (local and remote). v Allows receipt of oper override notices (requires the override module). x Allows receipt of local X-line notices (G/Z/Q/K/E/R/SHUN/CBan). - X Allows receipt of remote X-line notices (G/Z/Q/K/E/R/SHUN/CBan)."> - -<helpop key="extbans" value="Extended Bans ----------- + X Allows receipt of remote X-line notices (G/Z/Q/K/E/R/SHUN/CBan). +"> +<helpop key="extbans" title="Extended Bans" value=" Extbans are split into two types; matching extbans, which match on users in additional ways, and acting extbans, which restrict users in different ways to a standard ban. @@ -1146,4 +1141,5 @@ or a Matching extban. There is an additional special type of extended ban, a redirect ban: Redirect n!u@h#channel will redirect the banned user to #channel - when they try to join (requires the banredirect module)."> + when they try to join (requires the banredirect module). +"> diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index a34e3ff94..e7ee65748 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -41,7 +41,22 @@ enum typedef std::vector<std::string> HelpMessage; -typedef std::map<std::string, HelpMessage, irc::insensitive_swo> HelpMap; +struct HelpTopic +{ + // The body of the help topic. + const HelpMessage body; + + // The title of the help topic. + const std::string title; + + HelpTopic(const HelpMessage& Body, const std::string& Title) + : body(Body) + , title(Title) + { + } +}; + +typedef std::map<std::string, HelpTopic, irc::insensitive_swo> HelpMap; class CommandHelpop : public Command { @@ -69,10 +84,11 @@ class CommandHelpop : public Command return CMD_FAILURE; } - user->WriteNumeric(RPL_HELPSTART, topic, InspIRCd::Format("*** Help for %s", topic.c_str())); - for (HelpMessage::const_iterator liter = titer->second.begin(); liter != titer->second.end(); ++liter) + const HelpTopic& entry = titer->second; + user->WriteNumeric(RPL_HELPSTART, topic, entry.title); + for (HelpMessage::const_iterator liter = entry.body.begin(); liter != entry.body.end(); ++liter) user->WriteNumeric(RPL_HELPTXT, topic, *liter); - user->WriteNumeric(RPL_ENDOFHELP, topic, "*** End of help"); + user->WriteNumeric(RPL_ENDOFHELP, topic, "End of /HELPOP."); return CMD_SUCCESS; } }; @@ -126,11 +142,18 @@ class ModuleHelpop irc::sepstream linestream(value, '\n', true); for (std::string line; linestream.GetToken(line); ) helpmsg.push_back(line.empty() ? " " : line); - newhelp[key] = helpmsg; + + // Read the help title and store the topic. + const std::string title = tag->getString("title", InspIRCd::Format("*** Help for %s", key.c_str()), 1); + if (!newhelp.insert(std::make_pair(key, HelpTopic(helpmsg, title))).second) + { + throw ModuleException(InspIRCd::Format("<helpop> tag with duplicate key '%s' at %s", + key.c_str(), tag->getTagLocation().c_str())); + } } // The number of items we can fit on a page. - HelpMessage& indexmsg = newhelp["index"]; + HelpMessage indexmsg; size_t maxcolumns = 80 / (longestkey + 2); for (HelpMap::iterator iter = newhelp.begin(); iter != newhelp.end(); ) { @@ -147,6 +170,7 @@ class ModuleHelpop } indexmsg.push_back(indexline); } + newhelp.insert(std::make_pair("index", HelpTopic(indexmsg, "List of help topics"))); cmd.help.swap(newhelp); ConfigTag* tag = ServerInstance->Config->ConfValue("helpmsg"); |