echo/modules/hostserv/src/waiting.rs
Jean 993f5b2eea
Rename the project to Echo (was fedserv)
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.
2026-07-14 15:24:41 +00:00

18 lines
747 B
Rust

use echo_api::{Sender, ServiceCtx, Store};
// WAITING: pending vhost requests awaiting approval. Operators only.
pub fn handle(me: &str, from: &Sender, ctx: &mut ServiceCtx, db: &dyn Store) {
if !super::require_oper(me, from, ctx) {
return;
}
let requests = db.vhost_requests();
if requests.is_empty() {
ctx.notice(me, from.uid, "No vhost requests are waiting.");
return;
}
ctx.notice(me, from.uid, format!("Pending vhost requests ({}):", requests.len()));
for (account, host) in &requests {
ctx.notice(me, from.uid, format!(" \x02{account}\x02{host}"));
}
ctx.notice(me, from.uid, "Approve with \x02ACTIVATE\x02 <account> or turn down with \x02REJECT\x02 <account>.");
}