3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-15 00:19:29 +01:00
Send snomasks for HS SET
This commit is contained in:
Shivaram Lingamneni 2021-11-29 02:14:16 -05:00
parent 20270aeb22
commit c51569420a

View File

@ -10,6 +10,7 @@ import (
"github.com/ergochat/irc-go/ircfmt" "github.com/ergochat/irc-go/ircfmt"
"github.com/ergochat/ergo/irc/sno"
"github.com/ergochat/ergo/irc/utils" "github.com/ergochat/ergo/irc/utils"
) )
@ -159,6 +160,7 @@ func validateVhost(server *Server, vhost string, oper bool) error {
} }
func hsSetHandler(service *ircService, server *Server, client *Client, command string, params []string, rb *ResponseBuffer) { func hsSetHandler(service *ircService, server *Server, client *Client, command string, params []string, rb *ResponseBuffer) {
oper := client.Oper()
user := params[0] user := params[0]
var vhost string var vhost string
@ -176,8 +178,10 @@ func hsSetHandler(service *ircService, server *Server, client *Client, command s
service.Notice(rb, client.t("An error occurred")) service.Notice(rb, client.t("An error occurred"))
} else if vhost != "" { } else if vhost != "" {
service.Notice(rb, client.t("Successfully set vhost")) service.Notice(rb, client.t("Successfully set vhost"))
server.snomasks.Send(sno.LocalVhosts, fmt.Sprintf("Operator %s set vhost %s on account %s", oper.Name, user, vhost))
} else { } else {
service.Notice(rb, client.t("Successfully cleared vhost")) service.Notice(rb, client.t("Successfully cleared vhost"))
server.snomasks.Send(sno.LocalVhosts, fmt.Sprintf("Operator %s cleared vhost on account %s", oper.Name, user))
} }
} }