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

Merge pull request #1838 from slingamn/relaymute

fix casefolding issue in muting RELAYMSG
This commit is contained in:
Shivaram Lingamneni 2021-11-16 19:16:23 -05:00 committed by GitHub
commit 43b0e020e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2735,7 +2735,7 @@ func relaymsgHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
message := utils.MakeMessage(rawMessage)
nick := msg.Params[1]
_, err := CasefoldName(nick)
cfnick, err := CasefoldName(nick)
if err != nil {
rb.Add(nil, server.name, "FAIL", "RELAYMSG", "INVALID_NICK", client.t("Invalid nickname"))
return false
@ -2744,7 +2744,7 @@ func relaymsgHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
rb.Add(nil, server.name, "FAIL", "RELAYMSG", "INVALID_NICK", fmt.Sprintf(client.t("Relayed nicknames MUST contain a relaymsg separator from this set: %s"), config.Server.Relaymsg.Separators))
return false
}
if channel.relayNickMuted(nick) {
if channel.relayNickMuted(cfnick) {
rb.Add(nil, server.name, "FAIL", "RELAYMSG", "BANNED", fmt.Sprintf(client.t("%s is banned from relaying to the channel"), nick))
return false
}