fix(channels): enforce reply_target naming consistency

This commit is contained in:
Chummy 2026-02-18 18:06:07 +08:00
parent a7a580a479
commit cad7fb8f22
3 changed files with 74 additions and 4 deletions

View file

@ -551,7 +551,7 @@ impl Channel for IrcChannel {
// Determine reply target: if sent to a channel, reply to channel;
// if DM (target == our nick), reply to sender
let is_channel = target.starts_with('#') || target.starts_with('&');
let reply_to = if is_channel {
let reply_target = if is_channel {
target.to_string()
} else {
sender_nick.to_string()
@ -566,7 +566,7 @@ impl Channel for IrcChannel {
let channel_msg = ChannelMessage {
id: format!("irc_{}_{seq}", chrono::Utc::now().timestamp_millis()),
sender: sender_nick.to_string(),
reply_target: reply_to,
reply_target,
content,
channel: "irc".to_string(),
timestamp: std::time::SystemTime::now()