Harden votekick: dedup votes, require member targets, fix trigger refs

This commit is contained in:
Jean Chevronnet 2026-07-19 18:52:26 +00:00
parent a7f13098e3
commit e4a2e76903
No known key found for this signature in database
2 changed files with 14 additions and 3 deletions

View file

@ -2898,6 +2898,7 @@
bs(&mut e, "SET #c VOTEKICK 2");
e.handle(NetEvent::UserConnect { uid: "000AAAAAV".into(), nick: "victim".into(), host: "h".into() , ip: "0.0.0.0".into() });
e.handle(NetEvent::UserConnect { uid: "000AAAAAC".into(), nick: "carol".into(), host: "h".into() , ip: "0.0.0.0".into() });
e.handle(NetEvent::Join { uid: "000AAAAAV".into(), channel: "#c".into(), op: false }); // the target must be in the channel
let kicked = |out: &[NetAction]| out.iter().any(|a| matches!(a, NetAction::Kick { from, uid, .. } if from.starts_with("42SB") && uid == "000AAAAAV"));
// First voter, then the same voter again (deduped) — no kick yet.