channels: replace Member's six parallel prefix bools (oprefix/owner/admin/op/halfop/voice) with a single u8 bitfield (PFX_*) + inline bool accessors/mutators — same semantics, one byte instead of six, no more risk of the flags drifting out of sync; all call sites go through op()/set_op()-style methods

This commit is contained in:
Jean Chevronnet 2026-08-19 02:47:04 +00:00
parent 16fae5b23c
commit 1aa02a08b9
6 changed files with 129 additions and 76 deletions

View file

@ -1384,11 +1384,11 @@ impl Server {
.map(|mem| {
let mut s = String::new();
for (on, c) in [
(mem.owner, 'q'),
(mem.admin, 'a'),
(mem.op, 'o'),
(mem.halfop, 'h'),
(mem.voice, 'v'),
(mem.owner(), 'q'),
(mem.admin(), 'a'),
(mem.op(), 'o'),
(mem.halfop(), 'h'),
(mem.voice(), 'v'),
] {
if on {
s.push(c);
@ -1579,8 +1579,8 @@ mod tests {
s.join(1, "#c", None); // ann creates -> gets @
s.join(2, "#c", None); // bob joins
assert!(s.channels["#c"].members[&1].op);
assert!(!s.channels["#c"].members[&2].op);
assert!(s.channels["#c"].members[&1].op());
assert!(!s.channels["#c"].members[&2].op());
assert_eq!(s.channels["#c"].members.len(), 2);
let ann: Vec<String> = arx.try_iter().collect();