Add three-tier services operator model (operator, administrator, root)
All checks were successful
CI / check (push) Successful in 4m22s
All checks were successful
CI / check (push) Successful in 4m22s
This commit is contained in:
parent
a10662bbc6
commit
fc214ab0d3
20 changed files with 177 additions and 74 deletions
|
|
@ -1,10 +1,14 @@
|
|||
use echo_api::{Sender, ServiceCtx};
|
||||
use echo_api::{Priv, Sender, ServiceCtx};
|
||||
|
||||
// REDACT <#channel|nick> <msgid> [reason]: delete a message by its IRCv3 msgid.
|
||||
// The msgid comes from the reporting oper's client (which saw the tagged message);
|
||||
// echo relays it as a server-trusted redaction, so no ircd oper privilege is needed
|
||||
// (draft/message-redaction). One-shot — nothing is stored.
|
||||
pub fn handle(me: &str, from: &Sender, args: &[&str], ctx: &mut ServiceCtx) {
|
||||
if !from.privs.has(Priv::Oper) {
|
||||
ctx.notice(me, from.uid, "Access denied — REDACT needs the \x02operator\x02 privilege.");
|
||||
return;
|
||||
}
|
||||
let (Some(&target), Some(&msgid)) = (args.get(1), args.get(2)) else {
|
||||
ctx.notice(me, from.uid, "Syntax: REDACT <#channel|nick> <msgid> [reason]");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue