forbid: type the FORBID kind as an enum at the store boundary, string only in storage
All checks were successful
CI / check (push) Successful in 3m56s

This commit is contained in:
Jean Chevronnet 2026-07-17 13:26:16 +00:00
parent 1fb3615b7e
commit 2c8ba4460d
No known key found for this signature in database
10 changed files with 91 additions and 49 deletions

View file

@ -1,4 +1,4 @@
use echo_api::{ChanError, ChannelView, Priv, Store};
use echo_api::{ChanError, ChannelView, ForbidKind, Priv, Store};
use echo_api::{HelpEntry, Sender, Service, ServiceCtx};
use echo_api::NetView;
@ -125,7 +125,7 @@ impl Service for ChanServ {
ctx.notice(me, from.uid, format!("You must be a channel operator (\x02@\x02) in \x02{chan}\x02 to register it."));
return;
}
if let Some(reason) = db.is_forbidden("CHAN", chan) {
if let Some(reason) = db.is_forbidden(ForbidKind::Chan, chan) {
ctx.notice(me, from.uid, format!("\x02{chan}\x02 can't be registered: {reason}"));
return;
}