From 9889aae2feefa7d057befdcc3e16e7f7f5562b9e Mon Sep 17 00:00:00 2001 From: Andriy Kushnir Date: Mon, 1 Dec 2025 09:20:15 +0200 Subject: [PATCH 1/3] Fix regression after new linter rules --- test/command_hint_test.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/command_hint_test.dart b/test/command_hint_test.dart index 68812be5f..84f558635 100644 --- a/test/command_hint_test.dart +++ b/test/command_hint_test.dart @@ -8,8 +8,7 @@ import 'utils/test_client.dart'; void main() async { test('Check for missing /command hints', () async { final translated = - jsonDecode(File('lib/l10n/intl_en.arb').readAsStringSync()) - .keys + jsonDecode(File('lib/l10n/intl_en.arb').readAsStringSync()).keys .where((String k) => k.startsWith('commandHint_')) .map((k) => k.replaceFirst('commandHint_', '')); final commands = (await prepareTestClient()).commands.keys; From dc64d1679bca577fd20b232aa05e8f6b48fc5394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Wed, 3 Dec 2025 09:04:31 +0100 Subject: [PATCH 2/3] chore: Follow up request history --- lib/pages/chat/chat_event_list.dart | 42 +++++++++++++++-------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/lib/pages/chat/chat_event_list.dart b/lib/pages/chat/chat_event_list.dart index 6cecb8b25..d119f14c5 100644 --- a/lib/pages/chat/chat_event_list.dart +++ b/lib/pages/chat/chat_event_list.dart @@ -84,9 +84,12 @@ class ChatEventList extends StatelessWidget { // Request history button or progress indicator: if (i == events.length + 1) { - if (controller.activeThreadId == null) { - return Builder( - builder: (context) { + if (controller.activeThreadId != null) { + return const SizedBox.shrink(); + } + return Builder( + builder: (context) { + if (timeline.canRequestHistory) { final visibleIndex = timeline.events.lastIndexWhere( (event) => !event.isCollapsedState && event.isVisibleInGui, @@ -96,23 +99,22 @@ class ChatEventList extends StatelessWidget { controller.requestHistory, ); } - return Center( - child: AnimatedSwitcher( - duration: FluffyThemes.animationDuration, - child: timeline.canRequestHistory - ? IconButton( - onPressed: controller.requestHistory, - icon: const Icon(Icons.refresh_outlined), - ) - : const CircularProgressIndicator.adaptive( - strokeWidth: 2, - ), - ), - ); - }, - ); - } - return const SizedBox.shrink(); + } + return Center( + child: AnimatedSwitcher( + duration: FluffyThemes.animationDuration, + child: timeline.canRequestHistory + ? IconButton( + onPressed: controller.requestHistory, + icon: const Icon(Icons.refresh_outlined), + ) + : const CircularProgressIndicator.adaptive( + strokeWidth: 2, + ), + ), + ); + }, + ); } i--; From 2c4a16d6086178cd5aefa8ea7db5d68fd6f3e8e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Wed, 3 Dec 2025 14:46:28 +0100 Subject: [PATCH 3/3] chore: Improve via calculation --- lib/pages/chat/chat.dart | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 61f2dec97..c64063595 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -1114,19 +1114,29 @@ class ChatController extends State } void goToNewRoomAction() async { - final newRoomId = room - .getState(EventTypes.RoomTombstone)! - .parsedTombstoneContent - .replacementRoom; final result = await showFutureLoadingDialog( context: context, - future: () => room.client.joinRoom( - room - .getState(EventTypes.RoomTombstone)! - .parsedTombstoneContent - .replacementRoom, - via: [newRoomId.domain!], - ), + future: () async { + final users = await room.requestParticipants( + [Membership.join, Membership.leave], + true, + false, + ); + users.sort((a, b) => a.powerLevel.compareTo(b.powerLevel)); + final via = users + .map((user) => user.id.domain) + .whereType() + .toSet() + .take(10) + .toList(); + return room.client.joinRoom( + room + .getState(EventTypes.RoomTombstone)! + .parsedTombstoneContent + .replacementRoom, + via: via, + ); + }, ); if (result.error != null) return; if (!mounted) return;