Split HelpServ into one file per command
REQUEST/CANCEL/LIST/VIEW/TAKE/NEXT/CLOSE each move to their own file; the oper guard and the shared claim helper stay in lib.rs beside the dispatcher. No behaviour change.
This commit is contained in:
parent
1916e5fce5
commit
368e6ba090
8 changed files with 144 additions and 115 deletions
13
modules/helpserv/src/take.rs
Normal file
13
modules/helpserv/src/take.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use fedserv_api::{Sender, ServiceCtx, Store};
|
||||
|
||||
// TAKE <id> (aka ASSIGN): claim a specific ticket.
|
||||
pub fn handle(me: &str, from: &Sender, id: Option<&str>, ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
if !super::require_oper(me, from, ctx) {
|
||||
return;
|
||||
}
|
||||
let Some(n) = id.and_then(|n| n.parse::<u64>().ok()) else {
|
||||
ctx.notice(me, from.uid, "Syntax: TAKE <id>");
|
||||
return;
|
||||
};
|
||||
super::take_id(me, from, n, ctx, db);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue