fluffychat merge

This commit is contained in:
ggurdin 2026-02-05 16:05:00 -05:00
commit e45edef6a0
No known key found for this signature in database
GPG key ID: A01CB41737CBB478
2 changed files with 43 additions and 31 deletions

View file

@ -1728,19 +1728,29 @@ class ChatController extends State<ChatPageWithRoom>
}
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<String>()
.toSet()
.take(10)
.toList();
return room.client.joinRoom(
room
.getState(EventTypes.RoomTombstone)!
.parsedTombstoneContent
.replacementRoom,
via: via,
);
},
);
if (result.error != null) return;
if (!mounted) return;

View file

@ -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) {