feat(signal): add reaction message support

- Add SignalReactionMessage type with emoji, targetAuthor, timestamp
- Handle reaction messages in monitor (log and skip for now)
- Prevents reactions from showing as unknown media
This commit is contained in:
Kasper Neist
2026-01-09 22:57:20 +01:00
committed by Peter Steinberger
parent 65cc92c06a
commit 94e7a98bf2

View File

@@ -41,6 +41,15 @@ type SignalEnvelope = {
dataMessage?: SignalDataMessage | null;
editMessage?: { dataMessage?: SignalDataMessage | null } | null;
syncMessage?: unknown;
reactionMessage?: SignalReactionMessage | null;
};
type SignalReactionMessage = {
emoji?: string | null;
targetAuthor?: string | null;
targetAuthorUuid?: string | null;
targetSentTimestamp?: number | null;
isRemove?: boolean | null;
};
type SignalDataMessage = {
@@ -305,6 +314,22 @@ export async function monitorSignalProvider(
const envelope = payload?.envelope;
if (!envelope) return;
if (envelope.syncMessage) return;
// Handle reaction messages
if (envelope.reactionMessage) {
const reaction = envelope.reactionMessage;
if (reaction.isRemove) return; // Ignore reaction removals
const emoji = reaction.emoji ?? "👍";
const sender = resolveSignalSender(envelope);
if (!sender) return;
const senderDisplay = formatSignalSenderDisplay(sender);
const senderName = envelope.sourceName ?? senderDisplay;
logVerbose(`signal reaction: ${emoji} from ${senderName}`);
// Skip processing reactions as messages for now - just log them
// Future: could dispatch as a notification or store for context
return;
}
const dataMessage =
envelope.dataMessage ?? envelope.editMessage?.dataMessage;
if (!dataMessage) return;