Merge pull request #4683 from pangeachat/merge-prod-into-main
Merge prod into main
This commit is contained in:
commit
97f7d486ed
3 changed files with 39 additions and 35 deletions
|
|
@ -237,34 +237,31 @@ class ChatView extends StatelessWidget {
|
|||
// #Pangea
|
||||
: controller.widget.backButton != null
|
||||
? controller.widget.backButton!
|
||||
// : FluffyThemes.isColumnMode(context)
|
||||
// ? null
|
||||
// Pangea#
|
||||
: FluffyThemes.isColumnMode(context)
|
||||
? null
|
||||
: StreamBuilder<Object>(
|
||||
stream: Matrix.of(context)
|
||||
.client
|
||||
.onSync
|
||||
.stream
|
||||
.where(
|
||||
: StreamBuilder<Object>(
|
||||
stream:
|
||||
Matrix.of(context).client.onSync.stream.where(
|
||||
(syncUpdate) => syncUpdate.hasRoomUpdate,
|
||||
),
|
||||
// #Pangea
|
||||
// builder: (context, _) => UnreadRoomsBadge(
|
||||
builder: (context, _) => Center(
|
||||
child: SizedBox(
|
||||
height: kToolbarHeight,
|
||||
child: UnreadRoomsBadge(
|
||||
// Pangea#
|
||||
filter: (r) => r.id != controller.roomId,
|
||||
badgePosition: BadgePosition.topEnd(
|
||||
end: 8,
|
||||
top: 4,
|
||||
),
|
||||
child: const Center(child: BackButton()),
|
||||
),
|
||||
// #Pangea
|
||||
// builder: (context, _) => UnreadRoomsBadge(
|
||||
builder: (context, _) => Center(
|
||||
child: SizedBox(
|
||||
height: kToolbarHeight,
|
||||
child: UnreadRoomsBadge(
|
||||
// Pangea#
|
||||
filter: (r) => r.id != controller.roomId,
|
||||
badgePosition: BadgePosition.topEnd(
|
||||
end: 8,
|
||||
top: 4,
|
||||
),
|
||||
child: const Center(child: BackButton()),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
titleSpacing: FluffyThemes.isColumnMode(context) ? 24 : 0,
|
||||
title: ChatAppBarTitle(controller),
|
||||
actions: _appBarActions(context),
|
||||
|
|
|
|||
|
|
@ -194,6 +194,10 @@ class PangeaInvitationSelectionController
|
|||
if (a.id == client.userID) return -1;
|
||||
if (b.id == client.userID) return 1;
|
||||
|
||||
// sort the bot to the top
|
||||
if (a.id == BotName.byEnvironment) return -1;
|
||||
if (b.id == BotName.byEnvironment) return 1;
|
||||
|
||||
if (participants != null) {
|
||||
final participantA = participants!.firstWhereOrNull((u) => u.id == a.id);
|
||||
final participantB = participants!.firstWhereOrNull((u) => u.id == b.id);
|
||||
|
|
@ -264,25 +268,27 @@ class PangeaInvitationSelectionController
|
|||
)
|
||||
.toList();
|
||||
|
||||
contacts.removeWhere((u) => u.id == BotName.byEnvironment);
|
||||
if (_room?.isSpace ?? false) {
|
||||
contacts.removeWhere((u) => u.id == BotName.byEnvironment);
|
||||
}
|
||||
contacts.sort(_sortUsers);
|
||||
return contacts;
|
||||
}
|
||||
|
||||
List<User> getContacts(BuildContext context) {
|
||||
final client = Matrix.of(context).client;
|
||||
participants!.removeWhere(
|
||||
(u) => ![Membership.join, Membership.invite].contains(u.membership),
|
||||
);
|
||||
final contacts = client.rooms
|
||||
.where((r) => r.isDirectChat)
|
||||
.map((r) => r.unsafeGetUserFromMemoryOrFallback(r.directChatMatrixID!))
|
||||
.toList();
|
||||
contacts.sort(
|
||||
(a, b) => a.calcDisplayname().toLowerCase().compareTo(
|
||||
b.calcDisplayname().toLowerCase(),
|
||||
),
|
||||
);
|
||||
|
||||
if (_room?.isSpace == false &&
|
||||
!contacts.any((u) => u.id == BotName.byEnvironment)) {
|
||||
final bot = _room?.unsafeGetUserFromMemoryOrFallback(
|
||||
BotName.byEnvironment,
|
||||
);
|
||||
if (bot != null) contacts.add(bot);
|
||||
}
|
||||
return contacts;
|
||||
}
|
||||
|
||||
|
|
@ -341,7 +347,9 @@ class PangeaInvitationSelectionController
|
|||
}
|
||||
|
||||
final results = response.results;
|
||||
results.removeWhere((profile) => profile.userId == BotName.byEnvironment);
|
||||
if (_room?.isSpace ?? false) {
|
||||
results.removeWhere((profile) => profile.userId == BotName.byEnvironment);
|
||||
}
|
||||
|
||||
setState(() {
|
||||
foundProfiles = List<Profile>.from(results);
|
||||
|
|
@ -364,8 +372,7 @@ class PangeaInvitationSelectionController
|
|||
|
||||
foundProfiles.removeWhere(
|
||||
(profile) =>
|
||||
participants?.indexWhere((u) => u.id == profile.userId) != -1 ||
|
||||
BotName.byEnvironment == profile.userId,
|
||||
participants?.indexWhere((u) => u.id == profile.userId) != -1,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ description: Learn a language while texting your friends.
|
|||
# Pangea#
|
||||
publish_to: none
|
||||
# On version bump also increase the build number for F-Droid
|
||||
version: 4.1.15+5
|
||||
version: 4.1.15+6
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue