diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bb8c43cd..259af2bca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - Telegram: allow reply-chain messages to bypass mention gating in groups. (#1038) — thanks @adityashaw2. - Messages: refresh live directory cache results when resolving targets. - Messages: mirror delivered outbound text/media into session transcripts. (#1031) — thanks @TSavo. +- Messages: avoid redundant sender envelopes for iMessage + Signal group chats. (#1080) — thanks @tyler6204. - Cron: isolated cron jobs now start a fresh session id on every run to prevent context buildup. - Docs: add `/help` hub, Node/npm PATH guide, and expand directory CLI docs. - Config: support env var substitution in config values. (#1044) — thanks @sebslight. diff --git a/src/auto-reply/reply/inbound-sender-meta.ts b/src/auto-reply/reply/inbound-sender-meta.ts index 1417cb767..d60b61e75 100644 --- a/src/auto-reply/reply/inbound-sender-meta.ts +++ b/src/auto-reply/reply/inbound-sender-meta.ts @@ -33,7 +33,8 @@ function hasSenderMetaLine(body: string, ctx: MsgContext): boolean { if (candidates.length === 0) return false; return candidates.some((candidate) => { const escaped = escapeRegExp(candidate); - // Check for sender at start of line OR after envelope header bracket + // Envelope bodies look like "[Signal ...] Alice: hi". + // Treat the post-header sender prefix as already having sender metadata. const pattern = new RegExp(`(^|\\n|\\]\\s*)${escaped}:\\s`, "i"); return pattern.test(body); }); diff --git a/src/imessage/monitor/monitor-provider.ts b/src/imessage/monitor/monitor-provider.ts index 3970cd1b2..d780e446a 100644 --- a/src/imessage/monitor/monitor-provider.ts +++ b/src/imessage/monitor/monitor-provider.ts @@ -383,8 +383,8 @@ export async function monitorIMessageProvider(opts: MonitorIMessageOpts = {}): P } const chatTarget = formatIMessageChatTarget(chatId); - // For groups: use chat name or just "Group" (channel "iMessage" is already shown) - // For DMs: show sender, only add id: suffix if raw differs from normalized + // For groups: use chat name or just "Group" (channel "iMessage" is already shown). + // For DMs: keep headers compact; only add id: suffix if raw differs from normalized. const fromLabel = isGroup ? `${message.chat_name || "Group"} id:${chatId ?? "unknown"}` : senderNormalized === sender diff --git a/src/signal/monitor/event-handler.ts b/src/signal/monitor/event-handler.ts index 42a0f2dab..e53179afa 100644 --- a/src/signal/monitor/event-handler.ts +++ b/src/signal/monitor/event-handler.ts @@ -65,8 +65,8 @@ export function createSignalEventHandler(deps: SignalEventHandlerDeps) { }; async function handleSignalInboundMessage(entry: SignalInboundEntry) { - // For groups: use group name or just "Group" (channel "Signal" is already shown) - // For DMs: show sender, only add id: suffix if display differs from name + // For groups: use group name or just "Group" (channel "Signal" is already shown). + // For DMs: keep headers compact; only add id: suffix if display differs from name. const fromLabel = entry.isGroup ? `${entry.groupName || "Group"} id:${entry.groupId}` : entry.senderName === entry.senderDisplay