mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
xline: Add snomasks for setting/removing xlines
This commit is contained in:
parent
5c725bb622
commit
5b3cea8b98
@ -319,11 +319,15 @@ func dlineHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
||||
server.dlines.AddNetwork(*hostNet, banTime, reason, operReason)
|
||||
}
|
||||
|
||||
var snoDescription string
|
||||
if durationIsUsed {
|
||||
client.Notice(fmt.Sprintf("Added temporary (%s) D-Line for %s", duration.String(), hostString))
|
||||
snoDescription = fmt.Sprintf(ircfmt.Unescape("%s$r added temporary (%s) D-Line for %s"), client.nick, duration.String(), hostString)
|
||||
} else {
|
||||
client.Notice(fmt.Sprintf("Added D-Line for %s", hostString))
|
||||
snoDescription = fmt.Sprintf(ircfmt.Unescape("%s$r added D-Line for %s"), client.nick, hostString)
|
||||
}
|
||||
server.snomasks.Send(sno.LocalXline, snoDescription)
|
||||
|
||||
var killClient bool
|
||||
if andKill {
|
||||
@ -423,6 +427,7 @@ func unDLineHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool
|
||||
}
|
||||
|
||||
client.Notice(fmt.Sprintf("Removed D-Line for %s", hostString))
|
||||
server.snomasks.Send(sno.LocalXline, fmt.Sprintf(ircfmt.Unescape("%s$r removed D-Line for %s"), client.nick, hostString))
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -230,11 +230,15 @@ func klineHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
||||
|
||||
server.klines.AddMask(mask, banTime, reason, operReason)
|
||||
|
||||
var snoDescription string
|
||||
if durationIsUsed {
|
||||
client.Notice(fmt.Sprintf("Added temporary (%s) K-Line for %s", duration.String(), mask))
|
||||
snoDescription = fmt.Sprintf(ircfmt.Unescape("%s$r added temporary (%s) K-Line for %s"), client.nick, duration.String(), mask)
|
||||
} else {
|
||||
client.Notice(fmt.Sprintf("Added K-Line for %s", mask))
|
||||
snoDescription = fmt.Sprintf(ircfmt.Unescape("%s$r added K-Line for %s"), client.nick, mask)
|
||||
}
|
||||
server.snomasks.Send(sno.LocalXline, snoDescription)
|
||||
|
||||
var killClient bool
|
||||
if andKill {
|
||||
@ -311,6 +315,7 @@ func unKLineHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool
|
||||
server.klines.RemoveMask(mask)
|
||||
|
||||
client.Notice(fmt.Sprintf("Removed K-Line for %s", mask))
|
||||
server.snomasks.Send(sno.LocalXline, fmt.Sprintf(ircfmt.Unescape("%s$r removed K-Line for %s"), client.nick, mask))
|
||||
return false
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user