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:
@@ -304,7 +304,8 @@ final class Reactions {
|
|||||||
|
|
||||||
/** The text that reacts with `emoji` (or takes it back), worded like an iPhone's. */
|
/** 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) {
|
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;
|
String what;
|
||||||
if (!body.isEmpty()) {
|
if (!body.isEmpty()) {
|
||||||
int n = body.codePointCount(0, body.length());
|
int n = body.codePointCount(0, body.length());
|
||||||
|
|||||||
+2
-2
@@ -26,8 +26,8 @@ import sys
|
|||||||
import zipfile
|
import zipfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
VERSION_NAME = "0.7.1"
|
VERSION_NAME = "0.7.2"
|
||||||
VERSION_CODE = 9
|
VERSION_CODE = 10
|
||||||
|
|
||||||
PACKAGE = "me.teafry.voipmessages"
|
PACKAGE = "me.teafry.voipmessages"
|
||||||
DEV_PACKAGE = PACKAGE + ".dev"
|
DEV_PACKAGE = PACKAGE + ".dev"
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "voipms-desktop",
|
"name": "voipms-desktop",
|
||||||
"productName": "bubble",
|
"productName": "bubble",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"description": "Signal-style desktop SMS client for voip.ms",
|
"description": "Signal-style desktop SMS client for voip.ms",
|
||||||
"author": "trav <trav@teafry.me>",
|
"author": "trav <trav@teafry.me>",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
Binary file not shown.
@@ -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"}
|
||||||
|
|||||||
@@ -255,7 +255,9 @@ export const DEFAULT_QUICK_REACTIONS = ['❤️', '👍', '👎', '😂', '‼
|
|||||||
// back), worded the way iPhones send it, so iPhones and Google Messages show
|
// back), worded the way iPhones send it, so iPhones and Google Messages show
|
||||||
// it as a reaction and everything else as "Loved “…”".
|
// it as a reaction and everything else as "Loved “…”".
|
||||||
export function reactionText(emoji: string, msg: { body: string; media?: unknown[] }, removed = false): string {
|
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
|
const what = body
|
||||||
? `“${[...body].length > MAX_QUOTE ? [...body].slice(0, MAX_QUOTE).join('').trimEnd() + '…' : body}”`
|
? `“${[...body].length > MAX_QUOTE ? [...body].slice(0, MAX_QUOTE).join('').trimEnd() + '…' : body}”`
|
||||||
: msg.media?.length
|
: msg.media?.length
|
||||||
|
|||||||
@@ -170,6 +170,13 @@ describe('reactionText', () => {
|
|||||||
expect(reactionText('🎉', { body: 'hi' }, true)).toBe('Removed a 🎉 from “hi”')
|
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', () => {
|
it('round-trips through the parser, long messages cut short', () => {
|
||||||
const long = 'word '.repeat(60).trim()
|
const long = 'word '.repeat(60).trim()
|
||||||
for (const e of ['❤️', '👍', '👎', '😂', '‼️', '❓', '🎉', '👨👩👧']) {
|
for (const e of ['❤️', '👍', '👎', '😂', '‼️', '❓', '🎉', '👨👩👧']) {
|
||||||
|
|||||||
Reference in New Issue
Block a user