Freeze ChanServ MODE/ACCESS/FLAGS on suspended channels and make PEACE group-access-aware

This commit is contained in:
Jean Chevronnet 2026-07-19 15:59:00 +00:00
parent 16d2a5035a
commit 8f41fc9903
No known key found for this signature in database
4 changed files with 14 additions and 2 deletions

View file

@ -378,7 +378,12 @@ fn peace_blocks(me: &str, from: &Sender, chan: &str, target_uid: &str, ctx: &mut
if target_uid == from.uid {
return false;
}
if info.access_rank(net.account_of(target_uid)) >= info.access_rank(from.account) {
// Group-aware rank: channel_caps resolves !group access (and founder), so PEACE
// protects a member whose access comes via a group, not just direct entries —
// ChannelView::access_rank is group-blind and let a plain op act against a
// group-SOP it should protect.
let rank = |account: Option<&str>| account.map_or(echo_api::Rank::None, |a| db.channel_caps(chan, a).rank);
if rank(net.account_of(target_uid)) >= rank(from.account) {
ctx.notice(me, from.uid, "\x02PEACE\x02 is set: you can't act against someone with equal or higher access.");
return true;
}