From f142bf065db6c278df7476d768a77c44c38283b9 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Sat, 19 May 2018 09:00:22 +1000 Subject: [PATCH] services: Explicitly show when commands have been disabled in the HELP output --- irc/services.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/irc/services.go b/irc/services.go index 2e7464a7..175b65ec 100644 --- a/irc/services.go +++ b/irc/services.go @@ -134,18 +134,24 @@ func serviceHelpHandler(service *ircService, server *Server, client *Client, par if params == "" { // show general help var shownHelpLines sort.StringSlice + var disabledCommands bool for _, commandInfo := range service.Commands { // skip commands user can't access if 0 < len(commandInfo.capabs) && !client.HasRoleCapabs(commandInfo.capabs...) { continue } if commandInfo.enabled != nil && !commandInfo.enabled(server) { + disabledCommands = true continue } shownHelpLines = append(shownHelpLines, " "+client.t(commandInfo.helpShort)) } + if disabledCommands { + shownHelpLines = append(shownHelpLines, " "+client.t("... and other commands which have been disabled")) + } + // sort help lines sort.Sort(shownHelpLines)