mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 18:52:41 +01:00
fix #1544
PerstentStatusMandatory should display as "enabled", not "mandatory", in the context where it refers to a user-chosen setting.
This commit is contained in:
parent
44ed0b7a38
commit
5c4984f45f
@ -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" {
|
||||
|
Loading…
Reference in New Issue
Block a user