소스 검색

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
Kenneth Lien 5 달 전
부모
커밋
c29338f276
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      external_plugins/imessage/server.ts

+ 4 - 1
external_plugins/imessage/server.ts

@@ -725,7 +725,10 @@ function handleInbound(r: Row): void {
 
   const text = messageText(r)
   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
   // sent-receipts anyway — the content lands on the is_from_me=0 copy below.