From 3054596d528c166598decafe60b6c050d85d5a96 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Mon, 21 Oct 2024 09:58:59 +0700 Subject: [PATCH] TW-1862: Fix can't display message in chat --- lib/pages/chat/chat.dart | 15 +++++++++++++-- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 0eecbeca8b..aa3f22ca94 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -354,12 +354,14 @@ class ChatController extends State Future requestHistory({ int? historyCount, + StateFilter? filter, }) async { if (!timeline!.canRequestHistory) return; Logs().v('Chat::requestHistory(): Requesting history...'); try { return timeline!.requestHistory( historyCount: historyCount ?? _loadHistoryCount, + filter: filter, ); } catch (err) { ScaffoldMessenger.of(context).showSnackBar( @@ -1748,10 +1750,19 @@ class ChatController extends State if (allMembershipEvents || canRequestHistory) { try { await requestHistory(historyCount: _defaultEventCountDisplay) - .then((response) { - Logs().d( + .then((response) async { + Logs().v( 'Chat::_tryRequestHistory():: Try request history success', ); + if (allMembershipEvents) { + await requestHistory( + historyCount: _defaultEventCountDisplay, + filter: StateFilter( + lazyLoadMembers: true, + types: [EventTypes.Message], + ), + ); + } }); } catch (e) { Logs().e( diff --git a/pubspec.lock b/pubspec.lock index afc9ff5fe7..c2a80cc80c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1875,8 +1875,8 @@ packages: dependency: "direct main" description: path: "." - ref: "twake-supported-0.22.6" - resolved-ref: "8435e632d7bce166085c6426fbfb4173457526f9" + ref: support-filter-for-request-history + resolved-ref: "420ed04a43f14b15aec6dda50fdad9d23b39414d" url: "git@github.com:linagora/matrix-dart-sdk.git" source: git version: "0.22.6" diff --git a/pubspec.yaml b/pubspec.yaml index 772e2f8eae..354cf9d925 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: matrix: git: url: git@github.com:linagora/matrix-dart-sdk.git - ref: twake-supported-0.22.6 + ref: support-filter-for-request-history receive_sharing_intent: git: