From 53a7e8c33440f42c92c1344236e50ea170b8dae5 Mon Sep 17 00:00:00 2001 From: Alex Jaspersen Date: Sun, 3 Oct 2021 16:35:22 -0700 Subject: [PATCH] Send snomask for channel mode changes via SAMODE. Fixes #1787 --- irc/handlers.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/irc/handlers.go b/irc/handlers.go index cbacabd9..441d0e8d 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -1741,8 +1741,16 @@ func cmodeHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respon return false } } + + isSamode := msg.Command == "SAMODE" + if isSamode { + message := fmt.Sprintf("Operator %s ran SAMODE %s", client.Oper().Name, strings.Join(msg.Params, " ")) + server.snomasks.Send(sno.LocalOpers, message) + server.logger.Info("opers", message) + } + // process mode changes, include list operations (an empty set of changes does a list) - applied := channel.ApplyChannelModeChanges(client, msg.Command == "SAMODE", changes, rb) + applied := channel.ApplyChannelModeChanges(client, isSamode, changes, rb) details := client.Details() isBot := client.HasMode(modes.Bot) announceCmodeChanges(channel, applied, details.nickMask, details.accountName, details.account, isBot, rb)