v0.7.2: bubble for Android 0.7.2 — reactions quote the message exactly, so the other phone can find it

This commit is contained in:
2026-11-11 04:50:28 -08:00
parent 5f68bb7267
commit 50ff68b6ee
7 changed files with 16 additions and 6 deletions
@@ -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());
+2 -2
View File
@@ -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"
+1 -1
View File
@@ -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 <trav@teafry.me>",
"private": true,
Binary file not shown.
+1 -1
View File
@@ -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"}
+3 -1
View File
@@ -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
+7
View File
@@ -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 ['❤️', '👍', '👎', '😂', '‼️', '❓', '🎉', '👨‍👩‍👧']) {