diff --git a/android/app/src/main/java/me/teafry/voipmessages/Reactions.java b/android/app/src/main/java/me/teafry/voipmessages/Reactions.java index 534ce0b..8dedc46 100644 --- a/android/app/src/main/java/me/teafry/voipmessages/Reactions.java +++ b/android/app/src/main/java/me/teafry/voipmessages/Reactions.java @@ -304,7 +304,8 @@ final class Reactions { /** The text that reacts with `emoji` (or takes it back), worded like an iPhone's. */ static String text(String emoji, Store.Msg m, boolean removed) { - String body = norm(m.body); + // Their exact text: the other phone matches the quote letter for letter. + String body = m.body == null ? "" : m.body.trim(); String what; if (!body.isEmpty()) { int n = body.codePointCount(0, body.length()); diff --git a/android/build.py b/android/build.py index 73601c9..3979ccf 100644 --- a/android/build.py +++ b/android/build.py @@ -26,8 +26,8 @@ import sys import zipfile from pathlib import Path -VERSION_NAME = "0.7.1" -VERSION_CODE = 9 +VERSION_NAME = "0.7.2" +VERSION_CODE = 10 PACKAGE = "me.teafry.voipmessages" DEV_PACKAGE = PACKAGE + ".dev" diff --git a/package.json b/package.json index 15a61c2..4c7b266 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "voipms-desktop", "productName": "bubble", - "version": "0.7.1", + "version": "0.7.2", "description": "Signal-style desktop SMS client for voip.ms", "author": "trav ", "private": true, diff --git a/resources/android/VoipMessages.apk b/resources/android/VoipMessages.apk index f3b8cc2..73e7585 100644 Binary files a/resources/android/VoipMessages.apk and b/resources/android/VoipMessages.apk differ diff --git a/resources/android/VoipMessages.json b/resources/android/VoipMessages.json index b45d980..bf9a387 100644 --- a/resources/android/VoipMessages.json +++ b/resources/android/VoipMessages.json @@ -1 +1 @@ -{"version_name": "0.7.1", "version_code": 9, "package": "me.teafry.voipmessages"} +{"version_name": "0.7.2", "version_code": 10, "package": "me.teafry.voipmessages"} diff --git a/src/shared/reactions.ts b/src/shared/reactions.ts index e5dbdb4..d76eb07 100644 --- a/src/shared/reactions.ts +++ b/src/shared/reactions.ts @@ -255,7 +255,9 @@ export const DEFAULT_QUICK_REACTIONS = ['❤️', '👍', '👎', '😂', '‼ // back), worded the way iPhones send it, so iPhones and Google Messages show // it as a reaction and everything else as "Loved “…”". export function reactionText(emoji: string, msg: { body: string; media?: unknown[] }, removed = false): string { - const body = norm(msg.body) + // Their exact text (curly apostrophes, line breaks and all): the other + // phone finds the message by comparing the quote letter for letter. + const body = msg.body.trim() const what = body ? `“${[...body].length > MAX_QUOTE ? [...body].slice(0, MAX_QUOTE).join('').trimEnd() + '…' : body}”` : msg.media?.length diff --git a/test/reactions.test.ts b/test/reactions.test.ts index 2ee835e..8c001eb 100644 --- a/test/reactions.test.ts +++ b/test/reactions.test.ts @@ -170,6 +170,13 @@ describe('reactionText', () => { expect(reactionText('🎉', { body: 'hi' }, true)).toBe('Removed a 🎉 from “hi”') }) + it('quotes their text exactly, so their phone can find it', () => { + expect(reactionText('👍', { body: ' I’m home\nsee you ' })).toBe('Liked “I’m home\nsee you”') + const a = msg('I’m home\nsee you') + const r = msg(reactionText('👍', a), { out: true }) + expect(foldReactions([a, r]).reactions.get(a.id)?.[0].emoji).toBe('👍') + }) + it('round-trips through the parser, long messages cut short', () => { const long = 'word '.repeat(60).trim() for (const e of ['❤️', '👍', '👎', '😂', '‼️', '❓', '🎉', '👨‍👩‍👧']) {