Don't install an already-expired gossiped akill as a permanent ban
This commit is contained in:
parent
75d3c70cc8
commit
007b02d380
1 changed files with 4 additions and 0 deletions
|
|
@ -1170,6 +1170,10 @@ impl Db {
|
||||||
});
|
});
|
||||||
// A freshly applied network ban must be pushed to the local ircd now.
|
// A freshly applied network ban must be pushed to the local ircd now.
|
||||||
let ban = applied.as_ref().and_then(|e| match e {
|
let ban = applied.as_ref().and_then(|e| match e {
|
||||||
|
// A gossiped akill whose `expires` is already in the past must NOT be
|
||||||
|
// installed: `saturating_sub` would floor to 0, which most ircds read as
|
||||||
|
// a permanent ban. Skip it entirely instead.
|
||||||
|
Event::AkillAdded { expires: Some(x), .. } if *x <= now() => None,
|
||||||
Event::AkillAdded { kind, mask, setter, reason, expires, .. } => Some(IngestEffect::BanAdded {
|
Event::AkillAdded { kind, mask, setter, reason, expires, .. } => Some(IngestEffect::BanAdded {
|
||||||
kind: kind.clone(),
|
kind: kind.clone(),
|
||||||
mask: mask.clone(),
|
mask: mask.clone(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue