Skip to content

Commit

Permalink
Merge branch 'main' into unenable-my-analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
ggurdin authored Jun 25, 2024
2 parents d959fdc + 1b69e1a commit 710a85f
Showing 1 changed file with 6 additions and 27 deletions.
33 changes: 6 additions & 27 deletions lib/pages/chat_list/chat_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:io';

import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:collection/collection.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pages/chat_list/chat_list_view.dart';
Expand Down Expand Up @@ -213,32 +212,12 @@ class ChatListController extends State<ChatList>
}

List<Room> get filteredRooms => Matrix.of(context)
.client
.rooms
.where(
getRoomFilterByActiveFilter(activeFilter),
)
// #Pangea
.sorted((roomA, roomB) {
// put rooms with unread messages at the top of the list
if (roomA.membership == Membership.invite &&
roomB.membership != Membership.invite) {
return -1;
}
if (roomA.membership != Membership.invite &&
roomB.membership == Membership.invite) {
return 1;
}

final bool aUnread = roomA.notificationCount > 0 || roomA.markedUnread;
final bool bUnread = roomB.notificationCount > 0 || roomB.markedUnread;
if (aUnread && !bUnread) return -1;
if (!aUnread && bUnread) return 1;

return 0;
})
// Pangea#
.toList();
.client
.rooms
.where(
getRoomFilterByActiveFilter(activeFilter),
)
.toList();

bool isSearchMode = false;
Future<QueryPublicRoomsResponse>? publicRoomsResponse;
Expand Down

0 comments on commit 710a85f

Please sign in to comment.