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

make an exception for saset

This commit is contained in:
Shivaram Lingamneni 2020-02-26 02:00:38 -05:00
parent 521617559f
commit 42ccd81205

View File

@ -471,10 +471,17 @@ func nsSetHandler(server *Server, client *Client, command string, params []strin
} }
} }
case "always-on": case "always-on":
// #821: it's problematic to alter the value of always-on if you're not
// the (actual or potential) always-on client yourself. make an exception
// for `saset` to give operators an escape hatch (any consistency problems
// can probably be fixed by restarting the server):
if command != "saset" {
details := client.Details() details := client.Details()
if details.nick != details.accountName { if details.nick != details.accountName {
err = errNickAccountMismatch err = errNickAccountMismatch
} else { }
}
if err == nil {
var newValue PersistentStatus var newValue PersistentStatus
newValue, err = persistentStatusFromString(params[1]) newValue, err = persistentStatusFromString(params[1])
// "opt-in" and "opt-out" don't make sense as user preferences // "opt-in" and "opt-out" don't make sense as user preferences