mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-29 07:29:31 +01:00
parent
76b0e44474
commit
fe8e6551c3
@ -1324,6 +1324,12 @@ func (channel *Channel) isMuted(client *Client) bool {
|
||||
return muteRe.MatchString(nuh) && !channel.lists[modes.ExceptMask].MatchMute(nuh)
|
||||
}
|
||||
|
||||
func (channel *Channel) relayNickMuted(relayNick string) bool {
|
||||
relayNUH := fmt.Sprintf("%s!*@*", relayNick)
|
||||
return channel.lists[modes.BanMask].MatchMute(relayNUH) &&
|
||||
!channel.lists[modes.ExceptMask].MatchMute(relayNUH)
|
||||
}
|
||||
|
||||
func msgCommandToHistType(command string) (history.ItemType, error) {
|
||||
switch command {
|
||||
case "PRIVMSG":
|
||||
|
@ -2647,6 +2647,10 @@ 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) {
|
||||
rb.Add(nil, server.name, "FAIL", "RELAYMSG", "BANNED", fmt.Sprintf(client.t("%s is banned from relaying to the channel"), nick))
|
||||
return false
|
||||
}
|
||||
|
||||
channel.AddHistoryItem(history.Item{
|
||||
Type: history.Privmsg,
|
||||
|
Loading…
Reference in New Issue
Block a user