xline: remove masks case-insensitively, matching how they're enforced
This commit is contained in:
parent
480b5faea0
commit
45f4ee552d
1 changed files with 4 additions and 1 deletions
|
|
@ -272,7 +272,10 @@ impl Server {
|
|||
/// Remove an x-line by kind + mask; returns whether one was found.
|
||||
pub fn remove_xline(&mut self, kind: XKind, mask: &str) -> bool {
|
||||
let before = self.xlines.len();
|
||||
self.xlines.retain(|x| !(x.kind == kind && x.mask == mask));
|
||||
// case-insensitive: nick/host/channel masks match case-insensitively when
|
||||
// enforced, so removal must too (e.g. remove `CBAN #foo` for a `#Foo` ban).
|
||||
self.xlines
|
||||
.retain(|x| !(x.kind == kind && x.mask.eq_ignore_ascii_case(mask)));
|
||||
let removed = self.xlines.len() < before;
|
||||
if removed {
|
||||
self.save_xlines();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue