diff --git a/irc/handlers.go b/irc/handlers.go index 79df2fdb..cee3599e 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -229,11 +229,13 @@ func registrationErrorToMessageAndCode(err error) (message, code string) { // helper function to dispatch messages when a client successfully registers func sendSuccessfulRegResponse(client *Client, rb *ResponseBuffer, forNS bool) { + details := client.Details() if forNS { nsNotice(rb, client.t("Account created")) } 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) } diff --git a/irc/nickserv.go b/irc/nickserv.go index fa3880dc..3f09d176 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -12,6 +12,7 @@ import ( "github.com/goshuirc/irc-go/ircfmt" "github.com/oragono/oragono/irc/modes" + "github.com/oragono/oragono/irc/sno" "github.com/oragono/oragono/irc/utils" ) @@ -671,6 +672,7 @@ func nsSaregisterHandler(server *Server, client *Client, command string, params nsNotice(rb, errMsg) } else { 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)) 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) {