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.",
|
"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",
|
"skipSupportingFluffyChat": "Skip supporting FluffyChat",
|
||||||
"iDoNotWantToSupport": "I do not want to support",
|
"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)
|
if (spacesWithPowerLevels.isNotEmpty)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
value: ChatContextAction.addToSpace,
|
value: ChatContextAction.addToSpace,
|
||||||
|
|
@ -728,6 +747,12 @@ class ChatListController extends State<ChatList>
|
||||||
context: context,
|
context: context,
|
||||||
future: () => space.setSpaceChild(room.id),
|
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,
|
open,
|
||||||
goToSpace,
|
goToSpace,
|
||||||
favorite,
|
favorite,
|
||||||
|
lowPriority,
|
||||||
markUnread,
|
markUnread,
|
||||||
mute,
|
mute,
|
||||||
leave,
|
leave,
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,17 @@ class ChatListItem extends StatelessWidget {
|
||||||
padding: EdgeInsets.only(left: 4.0),
|
padding: EdgeInsets.only(left: 4.0),
|
||||||
child: Icon(Icons.notifications_off_outlined, size: 16),
|
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)
|
if (room.isFavourite)
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue