diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 7369b6ccd..d89fe55a6 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -1728,19 +1728,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; diff --git a/lib/pages/chat/chat_event_list.dart b/lib/pages/chat/chat_event_list.dart index 497624e10..1601186e1 100644 --- a/lib/pages/chat/chat_event_list.dart +++ b/lib/pages/chat/chat_event_list.dart @@ -103,9 +103,12 @@ class ChatEventList extends StatelessWidget { // if (i == events.length + 1) { if (i == events.length + 2) { // Pangea# - 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, @@ -120,23 +123,22 @@ class ChatEventList extends StatelessWidget { ); // Pangea# } - 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, + ), + ), + ); + }, + ); } // #Pangea if (i == 1) {