Persist the channel topic setter as a nick!ident@host mask for KEEPTOPIC and INFO
All checks were successful
CI / check (push) Successful in 5m34s

This commit is contained in:
Jean Chevronnet 2026-07-21 09:26:41 +00:00
parent 9ccc681a62
commit 948a59707e
No known key found for this signature in database
17 changed files with 102 additions and 35 deletions

View file

@ -193,6 +193,9 @@ impl Service for ChanServ {
ctx.notice(me, from.uid, t!(ctx, " Email : {email}", email = info.email));
}
ctx.notice(me, from.uid, t!(ctx, " Registered : {when}", when = echo_api::human_time(info.ts)));
if !info.topic_setter.is_empty() {
ctx.notice(me, from.uid, t!(ctx, " Topic by : \x02{who}\x02", who = info.topic_setter));
}
if let Some(s) = db.channel_suspension(chan) {
ctx.notice(me, from.uid, t!(ctx, " Suspended : by \x02{by}\x02 — {reason}", by = s.by, reason = s.reason));
}

View file

@ -12,10 +12,10 @@ pub fn handle(me: &str, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, db:
return;
}
let text = if args.len() > 2 { args[2..].join(" ") } else { String::new() };
ctx.topic(me, chan, &text);
ctx.topic(me, chan, &text, from.nick);
// Persist it too: the ircd filters our own FTOPIC back out, so without this the
// stored topic stays stale and KEEPTOPIC/TOPICLOCK restore the old one on
// recreation/restart. Ignore NoChannel (require_op already proved it exists).
let _ = db.set_channel_topic(chan, &text);
let _ = db.set_channel_topic(chan, &text, from.nick);
ctx.notice(me, from.uid, t!(ctx, "Topic for \x02{chan}\x02 updated.", chan = chan));
}