Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions irc/nickserv.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,10 @@ func nsGetHandler(service *ircService, server *Server, client *Client, command s
return
}

displaySetting(service, params[0], accountData.Settings, client, rb)
displaySetting(service, params[0], accountData.Settings, account, command == "saget", client, rb)
}

func displaySetting(service *ircService, settingName string, settings AccountSettings, client *Client, rb *ResponseBuffer) {
func displaySetting(service *ircService, settingName string, settings AccountSettings, accountName string, privileged bool, client *Client, rb *ResponseBuffer) {
config := client.server.Config()
switch strings.ToLower(settingName) {
case "enforce":
Expand Down Expand Up @@ -485,7 +485,11 @@ 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"), userPersistentStatusToString(stored)))
if privileged {
service.Notice(rb, fmt.Sprintf(client.t("Stored always-on setting for account %s is: %s"), accountName, userPersistentStatusToString(stored)))
} else {
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"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the issue applies here as well:

  1. anything in displaySetting that references "you" or "your"
  2. "Successfully changed your account settings" in nsSetHandler
  3. Possibly other places

} else {
Expand Down Expand Up @@ -694,8 +698,12 @@ func nsSetHandler(service *ircService, server *Server, client *Client, command s

switch err {
case nil:
service.Notice(rb, client.t("Successfully changed your account settings"))
displaySetting(service, key, finalSettings, client, rb)
if privileged {
service.Notice(rb, fmt.Sprintf(client.t("Successfully changed account settings for %s"), account))
} else {
service.Notice(rb, client.t("Successfully changed your account settings"))
}
displaySetting(service, key, finalSettings, account, privileged, client, rb)
case errInvalidParams, errAccountDoesNotExist, errFeatureDisabled, errAccountUnverified, errAccountUpdateFailed:
service.Notice(rb, client.t(err.Error()))
case errNickAccountMismatch:
Expand Down Expand Up @@ -747,7 +755,7 @@ func nsVerifyEmailHandler(service *ircService, server *Server, client *Client, c
switch err {
case nil:
service.Notice(rb, client.t("Successfully changed your account settings"))
displaySetting(service, "email", client.AccountSettings(), client, rb)
displaySetting(service, "email", client.AccountSettings(), client.Account(), false, client, rb)
case errAccountVerificationInvalidCode:
service.Notice(rb, client.t(err.Error()))
default:
Expand Down