fluffychat/lib/utils
wcjord 6f32aab48b
fix: show "knock accepted" push notification body instead of "You have been invited" (#5823) (#5835)
* fix: show knock-accepted notification body when invite follows a knock (#5823)

When Synapse accepts a knock it sends an m.room.member invite event. The client
was displaying the generic 'You have been invited by X' push notification body
because the invite event alone doesn't carry prev_content on the push path.

Use KnockTracker (already used for auto-join) to detect knock-accepted invites
and show a dedicated 'Your join request was accepted!' notification body instead.

- Add knockAccepted string to intl_en.arb
- Extract condition into isKnockAcceptedInvite() pure util for testability
- Expose KnockTracker.getKnockedRoomIds() publicly (was _getKnockedRoomIds)
- Override notification body in push_helper.dart (background) and
  local_notifications_extension.dart (foreground/web)
- Unit tests for all isKnockAcceptedInvite() branches (9 tests)

* formatting

* fix up pangea comments

* fix: avoid race condition with knocked room account data updates and local push notification content

* translations

---------

Co-authored-by: ggurdin <ggurdin@gmail.com>
2026-02-27 12:29:50 -05:00
..
matrix_sdk_extensions Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
voip Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
account_bundles.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
account_config.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
adaptive_bottom_sheet.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
background_push.dart 5759 if session filled redirect from choose role (#5815) 2026-02-26 10:35:24 -05:00
beautify_string_extension.dart style: Use robotomono to display device keys 2023-02-17 08:45:49 +01:00
client_download_content_extension.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
client_manager.dart 5719 level up issues (#5750) 2026-02-18 15:45:32 -05:00
code_highlight_theme.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
color_value.dart fix: fix dart formatting for CI (#1368) 2025-01-07 08:32:42 -05:00
custom_http_client.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
custom_scroll_behaviour.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
date_time_extension.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
error_reporter.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
event_checkbox_extension.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
file_description.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
file_selector.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
fluffy_share.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
init_with_restore.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
localized_exception_extension.dart chore: replace default synapse error message on knock banned room (#5798) 2026-02-24 15:01:19 -05:00
markdown_context_builder.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
notification_background_handler.dart fix: show "knock accepted" push notification body instead of "You have been invited" (#5823) (#5835) 2026-02-27 12:29:50 -05:00
other_party_can_receive.dart Fluffychat merge (#1685) 2025-02-03 12:36:46 -05:00
platform_infos.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
push_helper.dart fix: show "knock accepted" push notification body instead of "You have been invited" (#5823) (#5835) 2026-02-27 12:29:50 -05:00
resize_video.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
room_status_extension.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
show_scaffold_dialog.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
show_update_snackbar.dart fluffychat merge 2025-06-09 16:02:38 -04:00
size_string.dart 1125 merge upstream fluffychat into main (#1184) 2024-12-09 14:17:44 -05:00
stream_extension.dart sorted imports again? 2023-12-04 03:13:10 +01:00
string_color.dart Fluffychat merge (#2731) 2025-05-08 13:22:26 -04:00
sync_status_localization.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
uia_request_manager.dart chore: make cancel button less prominent in email verification registration dialog (#5682) 2026-02-12 13:56:23 -05:00
url_launcher.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00
voip_plugin.dart Fluffychat merge 2 (#5590) 2026-02-10 08:01:12 -05:00