PerstentStatusMandatory should display as "enabled", not "mandatory",
in the context where it refers to a user-chosen setting.
This commit is contained in:
Shivaram Lingamneni 2021-03-11 00:43:07 -05:00
parent 44ed0b7a38
commit 5c4984f45f
1 changed files with 11 additions and 2 deletions

View File

@ -425,7 +425,7 @@ func displaySetting(service *ircService, settingName string, settings AccountSet
case "always-on":
stored := settings.AlwaysOn
actual := persistenceEnabled(config.Accounts.Multiclient.AlwaysOn, stored)
service.Notice(rb, fmt.Sprintf(client.t("Your stored always-on setting is: %s"), persistentStatusToString(stored)))
service.Notice(rb, fmt.Sprintf(client.t("Your stored always-on setting is: %s"), userPersistentStatusToString(stored)))
if actual {
service.Notice(rb, client.t("Given current server settings, your client is always-on"))
} else {
@ -447,7 +447,7 @@ func displaySetting(service *ircService, settingName string, settings AccountSet
stored := settings.AutoAway
alwaysOn := persistenceEnabled(config.Accounts.Multiclient.AlwaysOn, settings.AlwaysOn)
actual := persistenceEnabled(config.Accounts.Multiclient.AutoAway, settings.AutoAway)
service.Notice(rb, fmt.Sprintf(client.t("Your stored auto-away setting is: %s"), persistentStatusToString(stored)))
service.Notice(rb, fmt.Sprintf(client.t("Your stored auto-away setting is: %s"), userPersistentStatusToString(stored)))
if actual && alwaysOn {
service.Notice(rb, client.t("Given current server settings, auto-away is enabled for your client"))
} else if actual && !alwaysOn {
@ -465,6 +465,15 @@ func displaySetting(service *ircService, settingName string, settings AccountSet
}
}
func userPersistentStatusToString(status PersistentStatus) string {
// #1544: "mandatory" as a user setting should display as "enabled"
result := persistentStatusToString(status)
if result == "mandatory" {
result = "enabled"
}
return result
}
func nsSetHandler(service *ircService, server *Server, client *Client, command string, params []string, rb *ResponseBuffer) {
var account string
if command == "saset" {