imessage: drop whitespace-only messages from tapbacks/receipts

Tapback reactions and read receipts synced from linked devices arrive
as chat.db rows with whitespace-only text. The existing empty-check
used falsy comparison which doesn't catch ' ' or invisible chars,
causing unsolicited replies to reaction taps.

Fixes #1041
This commit is contained in:
Kenneth Lien 2026-03-26 23:11:49 -07:00
parent 03a685d5f6
commit c29338f276
No known key found for this signature in database

View File

@ -725,7 +725,10 @@ function handleInbound(r: Row): void {
const text = messageText(r) const text = messageText(r)
const hasAttachments = r.cache_has_attachments === 1 const hasAttachments = r.cache_has_attachments === 1
if (!text && !hasAttachments) return // Tapbacks, read receipts, and other sync noise from linked devices land
// as rows with whitespace-only text or bare attachment flags. trim() so
// they don't trigger unsolicited replies. See #1041.
if (!text.trim() && !hasAttachments) return
// Never deliver our own sends. In self-chat the is_from_me=1 rows are empty // Never deliver our own sends. In self-chat the is_from_me=1 rows are empty
// sent-receipts anyway — the content lands on the is_from_me=0 copy below. // sent-receipts anyway — the content lands on the is_from_me=0 copy below.