3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 18:52:41 +01:00
This commit is contained in:
Shivaram Lingamneni 2019-12-19 09:27:54 -05:00
parent 9d56677691
commit 0c33c3399f
2 changed files with 7 additions and 1 deletions

View File

@ -229,11 +229,13 @@ func registrationErrorToMessageAndCode(err error) (message, code string) {
// helper function to dispatch messages when a client successfully registers // helper function to dispatch messages when a client successfully registers
func sendSuccessfulRegResponse(client *Client, rb *ResponseBuffer, forNS bool) { func sendSuccessfulRegResponse(client *Client, rb *ResponseBuffer, forNS bool) {
details := client.Details()
if forNS { if forNS {
nsNotice(rb, client.t("Account created")) nsNotice(rb, client.t("Account created"))
} else { } else {
rb.Add(nil, client.server.name, RPL_REG_SUCCESS, client.nick, client.AccountName(), client.t("Account created")) rb.Add(nil, client.server.name, RPL_REG_SUCCESS, details.nick, details.accountName, client.t("Account created"))
} }
client.server.snomasks.Send(sno.LocalAccounts, fmt.Sprintf(ircfmt.Unescape("Client $c[grey][$r%s$c[grey]] registered account $c[grey][$r%s$c[grey]]"), details.nickMask, details.accountName))
sendSuccessfulAccountAuth(client, rb, forNS, false) sendSuccessfulAccountAuth(client, rb, forNS, false)
} }

View File

@ -12,6 +12,7 @@ import (
"github.com/goshuirc/irc-go/ircfmt" "github.com/goshuirc/irc-go/ircfmt"
"github.com/oragono/oragono/irc/modes" "github.com/oragono/oragono/irc/modes"
"github.com/oragono/oragono/irc/sno"
"github.com/oragono/oragono/irc/utils" "github.com/oragono/oragono/irc/utils"
) )
@ -671,6 +672,7 @@ func nsSaregisterHandler(server *Server, client *Client, command string, params
nsNotice(rb, errMsg) nsNotice(rb, errMsg)
} else { } else {
nsNotice(rb, fmt.Sprintf(client.t("Successfully registered account %s"), account)) nsNotice(rb, fmt.Sprintf(client.t("Successfully registered account %s"), account))
server.snomasks.Send(sno.LocalAccounts, fmt.Sprintf(ircfmt.Unescape("Operator $c[grey][$r%s$c[grey]] registered account $c[grey][$r%s$c[grey]] with SAREGISTER"), client.Oper().Name, account))
} }
} }
@ -717,6 +719,8 @@ func nsUnregisterHandler(server *Server, client *Client, command string, params
nsNotice(rb, fmt.Sprintf(client.t("Successfully unregistered account %s"), cfname)) nsNotice(rb, fmt.Sprintf(client.t("Successfully unregistered account %s"), cfname))
server.logger.Info("accounts", "client", client.Nick(), "unregistered account", cfname) server.logger.Info("accounts", "client", client.Nick(), "unregistered account", cfname)
} }
client.server.snomasks.Send(sno.LocalAccounts, fmt.Sprintf(ircfmt.Unescape("Client $c[grey][$r%s$c[grey]] unregistered account $c[grey][$r%s$c[grey]]"), client.NickMaskString(), account.Name))
} }
func nsVerifyHandler(server *Server, client *Client, command string, params []string, rb *ResponseBuffer) { func nsVerifyHandler(server *Server, client *Client, command string, params []string, rb *ResponseBuffer) {