3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 11:59:40 +01:00

HELP: Check topics exist at startup, fix a bug

This commit is contained in:
Daniel Oaks 2016-10-23 18:59:13 +10:00
parent a7949b6cb4
commit 194fa9af9f
3 changed files with 71 additions and 30 deletions

View File

@ -19,6 +19,7 @@ New release of Oragono!
### Removed
### Fixed
* Fixed bug where `HELP` wouldn't correctly display for operators, and added more help topics.
## [0.3.0] - 2016-10-23

View File

@ -90,6 +90,11 @@ Prints debug information about the IRCd. <option> can be one of:
* STARTCPUPROFILE: Starts the CPU profiler.
* STOPCPUPROFILE: Stops the CPU profiler.
* PROFILEHEAP: Writes out the CPU profiler info.`,
},
"help": {
text: `HELP <argument>
Get an explanation of <argument>.`,
},
"invite": {
text: `INVITE <nickname> <channel>
@ -134,6 +139,27 @@ channels). <elistcond>s modify how the channels are selected.`,
Sets and removes modes from the given target. For more specific information on
mode characters, see the help for "cmode" and "umode".`,
},
"monitor": {
text: `MONITOR <subcmd>
Allows the monitoring of nicknames, for alerts when they are online and
offline. The subcommands are:
MONITOR + target{,target}
Adds the given names to your list of monitored nicknames.
MONITOR - target{,target}
Removes the given names from your list of monitored nicknames.
MONITOR C
Clears your list of monitored nicknames.
MONITOR L
Lists all the nicknames you are currently monitoring.
MONITOR S
Lists whether each nick in your MONITOR list is online or offline.`,
},
"motd": {
text: `MOTD [server]
@ -205,6 +231,12 @@ REG VERIFY <accountname> <auth_code>
Used in account registration. See the relevant specs for more info:
https://github.com/DanielOaks/ircv3-specifications/blob/register-and-verify/extensions/reg-core-3.3.md`,
},
"rehash": {
oper: true,
text: `REHASH
Reloads the config file and updates TLS certificates on listeners`,
},
"time": {
text: `TIME [server]
@ -312,7 +344,7 @@ Get an explanation of <argument>.`)
helpHandler, exists := Help[argument]
if exists && (!client.flags[Operator] || (helpHandler.oper && client.flags[Operator])) {
if exists && (!helpHandler.oper || (helpHandler.oper && client.flags[Operator])) {
client.sendHelp(strings.ToUpper(argument), helpHandler.text)
} else {
args := msg.Params

View File

@ -114,6 +114,14 @@ func NewServer(configFilename string, config *Config) *Server {
return nil
}
// startup check that we have HELP entries for every command
for name := range Commands {
_, exists := Help[strings.ToLower(name)]
if !exists {
log.Fatal("Help entry does not exist for ", name)
}
}
if config.AuthenticationEnabled {
SupportedCapabilities[SASL] = true
}