From 9ac72c962d2f2b5a3d1a32357edf0e58a3145f11 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Tue, 18 Nov 2025 14:44:56 -0500 Subject: [PATCH 1/2] chore: show bot in group chat invite page --- .../pages/pangea_invitation_selection.dart | 31 ++++++++++++------- pubspec.yaml | 2 +- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/lib/pangea/chat_settings/pages/pangea_invitation_selection.dart b/lib/pangea/chat_settings/pages/pangea_invitation_selection.dart index a78b0286e..e02d2c048 100644 --- a/lib/pangea/chat_settings/pages/pangea_invitation_selection.dart +++ b/lib/pangea/chat_settings/pages/pangea_invitation_selection.dart @@ -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 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.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, ); }); } diff --git a/pubspec.yaml b/pubspec.yaml index e64febf56..9c3f86aa9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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" From 7e8801f3e7a526480e14057d0a5ff2df21010502 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Tue, 18 Nov 2025 14:55:18 -0500 Subject: [PATCH 2/2] chore: show chat view back button in column mode --- lib/pages/chat/chat_view.dart | 41 ++++++++++++++++------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index 53bc9eaac..90cf94d50 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -232,34 +232,31 @@ class ChatView extends StatelessWidget { // #Pangea : controller.widget.backButton != null ? controller.widget.backButton! + // : FluffyThemes.isColumnMode(context) + // ? null // Pangea# - : FluffyThemes.isColumnMode(context) - ? null - : StreamBuilder( - stream: Matrix.of(context) - .client - .onSync - .stream - .where( + : StreamBuilder( + 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),