Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3788,5 +3788,15 @@
"interactiveVerificationDescription": "If you are next to each other or communicate over a secure channel, then you may verify all devices at once.",
"messageLayout": "Message layout",
"bubblesLayout": "Bubbles",
"modernLayout": "Modern"
"modernLayout": "Modern",
"invites": "Invites",
"@invites": {
"type": "String",
"placeholders": {}
},
"enableInvitesTab": "\"Invites\" tab",
"@enableInvitesTab": {
"type": "String",
"placeholders": {}
}
}
12 changes: 11 additions & 1 deletion assets/l10n/intl_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3860,5 +3860,15 @@
"interactiveVerificationDescription": "Если вы находитесь рядом или разговариваете по защищённому каналу связи, вы можете подтвердить все устройства.",
"messageLayout": "Вид сообщений",
"bubblesLayout": "Пузыри",
"modernLayout": "Современный"
"modernLayout": "Современный",
"invites": "Приглашения",
"@invites": {
"type": "String",
"placeholders": {}
},
"enableInvitesTab": "Вкладка \"Приглашения\"",
"@enableInvitesTab": {
"type": "String",
"placeholders": {}
}
}
1 change: 1 addition & 0 deletions lib/config/setting_keys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum AppSettings<T> {
messageStyle<String>('xyz.extera.messageStyle', 'bubbles'),
fallbackFonts<String>('xyz.extera.fallbackFonts', ''),
enablePeopleTab<bool>('xyz.extera.enablePeopleTab', true),
enableInvitesTab<bool>('xyz.extera.enableInvitesTab', true),
autoLoadMedia<bool>('xyz.extera.autoLoadMedia', true),
showCameraButton<bool>('xyz.extera.cameraButton', true),
stickerScale<double>('xyz.extera.stickerScale', 2),
Expand Down
15 changes: 12 additions & 3 deletions lib/pages/chat_list/chat_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum PopupMenuAction {
archive,
}

enum ActiveFilter { allChats, messages, groups, unread, spaces, people }
enum ActiveFilter { allChats, messages, groups, unread, invites, spaces, people }

extension LocalizedActiveFilter on ActiveFilter {
String toLocalizedString(BuildContext context) {
Expand All @@ -57,6 +57,8 @@ extension LocalizedActiveFilter on ActiveFilter {
return L10n.of(context).unread;
case ActiveFilter.groups:
return L10n.of(context).groups;
case ActiveFilter.invites:
return L10n.of(context).invites;
case ActiveFilter.spaces:
return L10n.of(context).spaces;
case ActiveFilter.people:
Expand All @@ -75,6 +77,8 @@ extension LocalizedActiveFilter on ActiveFilter {
: Icons.mark_unread_chat_alt;
case .groups:
return outline ? Icons.people_outline : Icons.people;
case .invites:
return outline ? Icons.mail_outline : Icons.mail;
case .spaces:
return outline ? Icons.grid_view_outlined : Icons.grid_view_rounded;
case .people:
Expand Down Expand Up @@ -166,6 +170,7 @@ class ChatListController extends State<ChatList>
case .allChats:
return (room) =>
!room.isSpace &&
(!AppSettings.enableInvitesTab.value || !room.membership.isInvite) &&
(AppSettings.showSpaceRoomsInGlobalList.value ||
room.spaceParents
.where((space) => spacesIds.contains(space.roomId))
Expand All @@ -174,6 +179,7 @@ class ChatListController extends State<ChatList>
return (room) =>
!room.isSpace &&
room.isDirectChat &&
(!AppSettings.enableInvitesTab.value || !room.membership.isInvite) &&
(AppSettings.showSpaceRoomsInGlobalList.value ||
room.spaceParents
.where((space) => spacesIds.contains(space.roomId))
Expand All @@ -182,14 +188,17 @@ class ChatListController extends State<ChatList>
return (room) =>
!room.isSpace &&
!room.isDirectChat &&
(!AppSettings.enableInvitesTab.value || !room.membership.isInvite) &&
(AppSettings.showSpaceRoomsInGlobalList.value ||
room.spaceParents
.where((space) => spacesIds.contains(space.roomId))
.isEmpty);
case .invites:
return (room) => room.membership.isInvite;
case .unread:
return (room) => room.isUnreadOrInvited;
return (room) => (!AppSettings.enableInvitesTab.value || !room.membership.isInvite) && room.isUnreadOrInvited;
case .spaces:
return (room) => room.isSpace;
return (room) => (!AppSettings.enableInvitesTab.value || !room.membership.isInvite) && room.isSpace;
case .people:
return (room) => false;
}
Expand Down
8 changes: 5 additions & 3 deletions lib/pages/chat_list/chat_list_bottom_navbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@ class _ChatListBottomNavbarState extends State<ChatListBottomNavbar> {
ActiveFilter.allChats,
if (AppSettings.separateChatTypes.value) ActiveFilter.groups,
ActiveFilter.unread,
if (AppSettings.enableInvitesTab.value) ActiveFilter.invites,
if (spaceDelegateCandidates.isNotEmpty &&
!_c.widget.displayNavigationRail)
ActiveFilter.spaces,
if (AppSettings.enablePeopleTab.value) ActiveFilter.people,
];

final filterLambdas = {
ActiveFilter.allChats: (Room room) => true,
ActiveFilter.messages: (Room room) => room.isDirectChat,
ActiveFilter.groups: (Room room) => !room.isDirectChat,
ActiveFilter.allChats: (Room room) =>(!AppSettings.enableInvitesTab.value || !room.membership.isInvite),
ActiveFilter.messages: (Room room) => (!AppSettings.enableInvitesTab.value || !room.membership.isInvite) && room.isDirectChat,
ActiveFilter.groups: (Room room) => (!AppSettings.enableInvitesTab.value || !room.membership.isInvite) && !room.isDirectChat,
ActiveFilter.unread: (Room room) => room.isUnread,
ActiveFilter.invites: (Room room) => room.membership.isInvite,
ActiveFilter.spaces: (Room room) => false,
ActiveFilter.people: (Room room) => false,
};
Expand Down
8 changes: 5 additions & 3 deletions lib/pages/chat_list/chat_list_legacy_bottom_navbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,19 @@ class _ChatListLegacyBottomNavbarState
ActiveFilter.allChats,
if (AppSettings.separateChatTypes.value) ActiveFilter.groups,
ActiveFilter.unread,
if (AppSettings.enableInvitesTab.value) ActiveFilter.invites,
if (spaceDelegateCandidates.isNotEmpty &&
!_c.widget.displayNavigationRail)
ActiveFilter.spaces,
if (AppSettings.enablePeopleTab.value) ActiveFilter.people,
];

final filterLambdas = {
ActiveFilter.allChats: (Room room) => true,
ActiveFilter.messages: (Room room) => room.isDirectChat,
ActiveFilter.groups: (Room room) => !room.isDirectChat,
ActiveFilter.allChats: (Room room) =>(!AppSettings.enableInvitesTab.value || !room.membership.isInvite),
ActiveFilter.messages: (Room room) => (!AppSettings.enableInvitesTab.value || !room.membership.isInvite) && room.isDirectChat,
ActiveFilter.groups: (Room room) => (!AppSettings.enableInvitesTab.value || !room.membership.isInvite) && !room.isDirectChat,
ActiveFilter.unread: (Room room) => room.isUnread,
ActiveFilter.invites: (Room room) => room.membership.isInvite,
ActiveFilter.spaces: (Room room) => false,
ActiveFilter.people: (Room room) => false,
};
Expand Down
5 changes: 5 additions & 0 deletions lib/pages/settings_features/settings_features_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ class SettingsFeaturesView extends StatelessWidget {
title: L10n.of(context).enablePeopleTab,
setting: AppSettings.enablePeopleTab,
),
const ListDivider(),
SettingsSwitchListTile.adaptive(
title: L10n.of(context).enableInvitesTab,
setting: AppSettings.enableInvitesTab,
),
if (PlatformInfos.isMobile) ...[
const ListDivider(),
SettingsSwitchListTile.adaptive(
Expand Down
16 changes: 8 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1394,10 +1394,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.17.0"
mgrs_dart:
dependency: transitive
description:
Expand Down Expand Up @@ -2271,26 +2271,26 @@ packages:
dependency: transitive
description:
name: test
sha256: "8d9ceddbab833f180fbefed08afa76d7c03513dfdba87ffcec2718b02bbcbf20"
sha256: "280d6d890011ca966ad08df7e8a4ddfab0fb3aa49f96ed6de56e3521347a9ae7"
url: "https://pub.dev"
source: hosted
version: "1.31.0"
version: "1.30.0"
test_api:
dependency: transitive
description:
name: test_api
sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a"
url: "https://pub.dev"
source: hosted
version: "0.7.11"
version: "0.7.10"
test_core:
dependency: transitive
description:
name: test_core
sha256: "1991d4cfe85d5043241acac92962c3977c8d2f2add1ee73130c7b286417d1d34"
sha256: "0381bd1585d1a924763c308100f2138205252fb90c9d4eeaf28489ee65ccde51"
url: "https://pub.dev"
source: hosted
version: "0.6.17"
version: "0.6.16"
timezone:
dependency: transitive
description:
Expand Down