Skip to content

Commit ab49fe0

Browse files
steipetetyler6204
andcommitted
fix: tidy iMessage/Signal sender envelopes (#1080) - thanks @tyler6204
Co-authored-by: Tyler Yust <[email protected]>
1 parent d0bc08a commit ab49fe0

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
- Telegram: allow reply-chain messages to bypass mention gating in groups. (#1038) — thanks @adityashaw2.
3737
- Messages: refresh live directory cache results when resolving targets.
3838
- Messages: mirror delivered outbound text/media into session transcripts. (#1031) — thanks @TSavo.
39+
- Messages: avoid redundant sender envelopes for iMessage + Signal group chats. (#1080) — thanks @tyler6204.
3940
- Cron: isolated cron jobs now start a fresh session id on every run to prevent context buildup.
4041
- Docs: add `/help` hub, Node/npm PATH guide, and expand directory CLI docs.
4142
- Config: support env var substitution in config values. (#1044) — thanks @sebslight.

src/auto-reply/reply/inbound-sender-meta.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ function hasSenderMetaLine(body: string, ctx: MsgContext): boolean {
3333
if (candidates.length === 0) return false;
3434
return candidates.some((candidate) => {
3535
const escaped = escapeRegExp(candidate);
36-
// Check for sender at start of line OR after envelope header bracket
36+
// Envelope bodies look like "[Signal ...] Alice: hi".
37+
// Treat the post-header sender prefix as already having sender metadata.
3738
const pattern = new RegExp(`(^|\\n|\\]\\s*)${escaped}:\\s`, "i");
3839
return pattern.test(body);
3940
});

src/imessage/monitor/monitor-provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ export async function monitorIMessageProvider(opts: MonitorIMessageOpts = {}): P
383383
}
384384

385385
const chatTarget = formatIMessageChatTarget(chatId);
386-
// For groups: use chat name or just "Group" (channel "iMessage" is already shown)
387-
// For DMs: show sender, only add id: suffix if raw differs from normalized
386+
// For groups: use chat name or just "Group" (channel "iMessage" is already shown).
387+
// For DMs: keep headers compact; only add id: suffix if raw differs from normalized.
388388
const fromLabel = isGroup
389389
? `${message.chat_name || "Group"} id:${chatId ?? "unknown"}`
390390
: senderNormalized === sender

src/signal/monitor/event-handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ export function createSignalEventHandler(deps: SignalEventHandlerDeps) {
6565
};
6666

6767
async function handleSignalInboundMessage(entry: SignalInboundEntry) {
68-
// For groups: use group name or just "Group" (channel "Signal" is already shown)
69-
// For DMs: show sender, only add id: suffix if display differs from name
68+
// For groups: use group name or just "Group" (channel "Signal" is already shown).
69+
// For DMs: keep headers compact; only add id: suffix if display differs from name.
7070
const fromLabel = entry.isGroup
7171
? `${entry.groupName || "Group"} id:${entry.groupId}`
7272
: entry.senderName === entry.senderDisplay

0 commit comments

Comments
 (0)