From caf20b44158dd09ad95498a534844ca57640a896 Mon Sep 17 00:00:00 2001 From: zjs81 Date: Sat, 24 Oct 2026 21:00:53 -0700 Subject: [PATCH] Summarize location, image and GIF messages in notifications Notification bodies now use the chat's parsers to show a localized summary for shared locations (m: markers), channel images, GIFs and reactions instead of the raw payload. The marker parser moves out of the map screen into helpers/marker_message.dart so the service can use it. --- lib/helpers/marker_message.dart | 30 ++++++++ lib/l10n/app_en.arb | 19 +++++ lib/l10n/app_localizations.dart | 30 ++++++++ lib/l10n/app_localizations_bg.dart | 19 +++++ lib/l10n/app_localizations_de.dart | 19 +++++ lib/l10n/app_localizations_en.dart | 19 +++++ lib/l10n/app_localizations_es.dart | 19 +++++ lib/l10n/app_localizations_fr.dart | 19 +++++ lib/l10n/app_localizations_hu.dart | 19 +++++ lib/l10n/app_localizations_it.dart | 19 +++++ lib/l10n/app_localizations_ja.dart | 19 +++++ lib/l10n/app_localizations_ko.dart | 19 +++++ lib/l10n/app_localizations_nl.dart | 19 +++++ lib/l10n/app_localizations_pl.dart | 19 +++++ lib/l10n/app_localizations_pt.dart | 19 +++++ lib/l10n/app_localizations_ru.dart | 19 +++++ lib/l10n/app_localizations_sk.dart | 19 +++++ lib/l10n/app_localizations_sl.dart | 19 +++++ lib/l10n/app_localizations_sv.dart | 19 +++++ lib/l10n/app_localizations_uk.dart | 19 +++++ lib/l10n/app_localizations_zh.dart | 19 +++++ lib/screens/channel_chat_screen.dart | 1 + lib/screens/chat_screen.dart | 1 + lib/screens/map_screen.dart | 30 +------- lib/services/notification_service.dart | 26 +++++-- test/screens/map_marker_parse_test.dart | 2 +- test/services/notification_text_test.dart | 45 ++++++++++++ untranslated.json | 85 +++++++++++++++++++++++ 28 files changed, 575 insertions(+), 36 deletions(-) create mode 100644 lib/helpers/marker_message.dart create mode 100644 test/services/notification_text_test.dart diff --git a/lib/helpers/marker_message.dart b/lib/helpers/marker_message.dart new file mode 100644 index 00000000..52f251c6 --- /dev/null +++ b/lib/helpers/marker_message.dart @@ -0,0 +1,30 @@ +import 'package:latlong2/latlong.dart'; + +class MarkerPayload { + final LatLng position; + final String label; + final String flags; + + MarkerPayload({ + required this.position, + required this.label, + required this.flags, + }); +} + +/// Parse a shared marker text message of the form +/// `m:,|