feat: Implement low priority for rooms
This commit is contained in:
parent
de96b27e29
commit
f961b22435
3 changed files with 40 additions and 1 deletions
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -595,6 +595,25 @@ class ChatListController extends State<ChatList>
|
|||
],
|
||||
),
|
||||
),
|
||||
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<ChatList>
|
|||
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,
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue