3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-15 00:19:29 +01:00

Send snomask for channel mode changes via SAMODE.

Fixes #1787
This commit is contained in:
Alex Jaspersen 2021-10-03 16:35:22 -07:00
parent 20d8d269ca
commit 53a7e8c334

View File

@ -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)