Migrate interpolated service messages to the t! macro (8 modules)
This commit is contained in:
parent
b462d37bd5
commit
d207c3d60d
133 changed files with 782 additions and 702 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use echo_api::{human_time, Sender, ServiceCtx, Store};
|
||||
use echo_api::{human_time, t, Sender, ServiceCtx, Store};
|
||||
|
||||
// VIEW <id> (aka READ): operators read a report in full.
|
||||
pub fn handle(me: &str, from: &Sender, id: Option<&str>, ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
|
|
@ -9,9 +9,9 @@ pub fn handle(me: &str, from: &Sender, id: Option<&str>, ctx: &mut ServiceCtx, d
|
|||
ctx.notice(me, from.uid, "No such report. Syntax: VIEW <id>");
|
||||
return;
|
||||
};
|
||||
ctx.notice(me, from.uid, format!("Report \x02#{}\x02 ({}):", r.id, if r.open { "open" } else { "closed" }));
|
||||
ctx.notice(me, from.uid, format!(" By : \x02{}\x02", r.reporter));
|
||||
ctx.notice(me, from.uid, format!(" About : \x02{}\x02", r.target));
|
||||
ctx.notice(me, from.uid, format!(" Filed : {}", human_time(r.ts)));
|
||||
ctx.notice(me, from.uid, format!(" Reason : {}", r.reason));
|
||||
ctx.notice(me, from.uid, t!(ctx, "Report \x02#{id}\x02 ({state}):", id = r.id, state = if r.open { "open" } else { "closed" }));
|
||||
ctx.notice(me, from.uid, t!(ctx, " By : \x02{by}\x02", by = r.reporter));
|
||||
ctx.notice(me, from.uid, t!(ctx, " About : \x02{target}\x02", target = r.target));
|
||||
ctx.notice(me, from.uid, t!(ctx, " Filed : {when}", when = human_time(r.ts)));
|
||||
ctx.notice(me, from.uid, t!(ctx, " Reason : {reason}", reason = r.reason));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue