3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-23 11:12:44 +01:00

Merge pull request #1800 from ajaspers/samode

Send snomask for channel mode changes via SAMODE.
This commit is contained in:
Shivaram Lingamneni 2021-10-03 23:29:28 -04:00 committed by GitHub
commit 1b55520006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)