From ddb6214b47ecd98b0d48287ecf96481cd1e919fe Mon Sep 17 00:00:00 2001 From: reverse Date: Fri, 21 Aug 2026 17:41:00 +0000 Subject: [PATCH] chanlog: post log lines as a channel PRIVMSG from the server, not a NOTICE --- src/modules/chanlog.rs | 4 +++- src/server.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/chanlog.rs b/src/modules/chanlog.rs index e53e53e..b01396b 100644 --- a/src/modules/chanlog.rs +++ b/src/modules/chanlog.rs @@ -30,9 +30,11 @@ pub fn tee(s: &Server, cat: char, msg: &str) { if !s.channels.contains_key(&key) { continue; // channel not created yet — nothing to log into } + // Posted as a PRIVMSG from the server, so clients show it inline in the + // channel as a normal message rather than routing it to a notices view. // to_channel builds the line once and shares it by Arc across members (and // adds the server-time tag per recipient) instead of cloning per member. - let line = format!(":{} NOTICE {chan} :{msg}", s.name); + let line = format!(":{} PRIVMSG {chan} :{msg}", s.name); s.to_channel(&key, &line, None); } } diff --git a/src/server.rs b/src/server.rs index b61685d..b02c4b3 100644 --- a/src/server.rs +++ b/src/server.rs @@ -1671,7 +1671,7 @@ mod tests { s.snotice_c('c', "CONNMSG"); let lines: Vec = std::iter::from_fn(|| rx.try_recv().ok()).collect(); let logged = |chan: &str, needle: &str| { - lines.iter().any(|l| l.contains(&format!("NOTICE {chan} :")) && l.contains(needle)) + lines.iter().any(|l| l.contains(&format!("PRIVMSG {chan} :")) && l.contains(needle)) }; assert!(logged("#xlog", "XLINEMSG"), "x-line notice goes to #xlog: {lines:?}"); assert!(logged("#all", "XLINEMSG"), "x-line notice goes to #all: {lines:?}");