diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index ce95fcd55..1ce086ee1 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -2787,5 +2787,7 @@ "fluffyChatSupportBannerMessage": "FluffyChat needs YOUR help!\n❤️❤️❤️\nFluffyChat will always be free, but development and hosting still cost money.\nThe future of the project depends on support from people like you.", "skipSupportingFluffyChat": "Skip supporting FluffyChat", "iDoNotWantToSupport": "I do not want to support", - "iAlreadySupportFluffyChat": "I already support FluffyChat" + "iAlreadySupportFluffyChat": "I already support FluffyChat", + "setLowPriority": "Set low priority", + "unsetLowPriority": "Unset low priority" } diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 5b11ab6dc..317a15aaa 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -595,6 +595,25 @@ class ChatListController extends State ], ), ), + PopupMenuItem( + value: ChatContextAction.lowPriority, + child: Row( + mainAxisSize: .min, + children: [ + Icon( + room.isLowPriority + ? Icons.low_priority + : Icons.low_priority_outlined, + ), + const SizedBox(width: 12), + Text( + room.isLowPriority + ? L10n.of(context).unsetLowPriority + : L10n.of(context).setLowPriority, + ), + ], + ), + ), if (spacesWithPowerLevels.isNotEmpty) PopupMenuItem( value: ChatContextAction.addToSpace, @@ -728,6 +747,12 @@ class ChatListController extends State context: context, future: () => space.setSpaceChild(room.id), ); + case ChatContextAction.lowPriority: + await showFutureLoadingDialog( + context: context, + future: () => room.setLowPriority(!room.isLowPriority), + ); + return; } } @@ -937,6 +962,7 @@ enum ChatContextAction { open, goToSpace, favorite, + lowPriority, markUnread, mute, leave, diff --git a/lib/pages/chat_list/chat_list_item.dart b/lib/pages/chat_list/chat_list_item.dart index b30828127..abe0cb87c 100644 --- a/lib/pages/chat_list/chat_list_item.dart +++ b/lib/pages/chat_list/chat_list_item.dart @@ -191,6 +191,17 @@ class ChatListItem extends StatelessWidget { padding: EdgeInsets.only(left: 4.0), child: Icon(Icons.notifications_off_outlined, size: 16), ), + if (room.isLowPriority) + Padding( + padding: EdgeInsets.only( + right: hasNotifications ? 4.0 : 0.0, + ), + child: Icon( + Icons.low_priority, + size: 16, + color: theme.colorScheme.primary, + ), + ), if (room.isFavourite) Padding( padding: EdgeInsets.only(