fix: tidy iMessage/Signal sender envelopes (#1080) - thanks @tyler6204
Co-authored-by: Tyler Yust <TYTYYUST@YAHOO.COM>
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
- Telegram: allow reply-chain messages to bypass mention gating in groups. (#1038) — thanks @adityashaw2.
|
- Telegram: allow reply-chain messages to bypass mention gating in groups. (#1038) — thanks @adityashaw2.
|
||||||
- Messages: refresh live directory cache results when resolving targets.
|
- Messages: refresh live directory cache results when resolving targets.
|
||||||
- Messages: mirror delivered outbound text/media into session transcripts. (#1031) — thanks @TSavo.
|
- 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.
|
- 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.
|
- Docs: add `/help` hub, Node/npm PATH guide, and expand directory CLI docs.
|
||||||
- Config: support env var substitution in config values. (#1044) — thanks @sebslight.
|
- Config: support env var substitution in config values. (#1044) — thanks @sebslight.
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ function hasSenderMetaLine(body: string, ctx: MsgContext): boolean {
|
|||||||
if (candidates.length === 0) return false;
|
if (candidates.length === 0) return false;
|
||||||
return candidates.some((candidate) => {
|
return candidates.some((candidate) => {
|
||||||
const escaped = escapeRegExp(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");
|
const pattern = new RegExp(`(^|\\n|\\]\\s*)${escaped}:\\s`, "i");
|
||||||
return pattern.test(body);
|
return pattern.test(body);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -383,8 +383,8 @@ export async function monitorIMessageProvider(opts: MonitorIMessageOpts = {}): P
|
|||||||
}
|
}
|
||||||
|
|
||||||
const chatTarget = formatIMessageChatTarget(chatId);
|
const chatTarget = formatIMessageChatTarget(chatId);
|
||||||
// For groups: use chat name or just "Group" (channel "iMessage" is already shown)
|
// 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 DMs: keep headers compact; only add id: suffix if raw differs from normalized.
|
||||||
const fromLabel = isGroup
|
const fromLabel = isGroup
|
||||||
? `${message.chat_name || "Group"} id:${chatId ?? "unknown"}`
|
? `${message.chat_name || "Group"} id:${chatId ?? "unknown"}`
|
||||||
: senderNormalized === sender
|
: senderNormalized === sender
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ export function createSignalEventHandler(deps: SignalEventHandlerDeps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function handleSignalInboundMessage(entry: SignalInboundEntry) {
|
async function handleSignalInboundMessage(entry: SignalInboundEntry) {
|
||||||
// For groups: use group name or just "Group" (channel "Signal" is already shown)
|
// 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 DMs: keep headers compact; only add id: suffix if display differs from name.
|
||||||
const fromLabel = entry.isGroup
|
const fromLabel = entry.isGroup
|
||||||
? `${entry.groupName || "Group"} id:${entry.groupId}`
|
? `${entry.groupName || "Group"} id:${entry.groupId}`
|
||||||
: entry.senderName === entry.senderDisplay
|
: entry.senderName === entry.senderDisplay
|
||||||
|
|||||||
Reference in New Issue
Block a user