Rebrand the daemon and workspace: the binary is now `echo`, every crate is `echo-*` (`echo-api` and the module crates), Rust imports use `echo_*`, the gRPC proto is `proto/echo.proto` with package `echo.v1`, and the log filter, gossip peer-name default, and on-disk store default (`echo.db.jsonl`) follow. Docs updated throughout. No behaviour change; crate directories and the config schema are untouched.
17 lines
620 B
Rust
17 lines
620 B
Rust
use echo_api::{Sender, ServiceCtx, Store};
|
|
|
|
// CLOSE <id> (aka RESOLVE): resolve a 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: CLOSE <id>");
|
|
return;
|
|
};
|
|
if db.help_close(n) {
|
|
ctx.notice(me, from.uid, format!("Ticket \x02#{n}\x02 closed."));
|
|
} else {
|
|
ctx.notice(me, from.uid, format!("Ticket \x02#{n}\x02 isn't open (or doesn't exist)."));
|
|
}
|
|
}
|