mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 23:09:35 +01:00
feat: Display indicator for unread muted rooms
This commit is contained in:
parent
be34303609
commit
3d7287993f
@ -224,7 +224,7 @@ class ChatController extends State<Chat> {
|
|||||||
}
|
}
|
||||||
filteredEvents = timeline!.getFilteredEvents(unfolded: unfolded);
|
filteredEvents = timeline!.getFilteredEvents(unfolded: unfolded);
|
||||||
timeline!.requestKeys();
|
timeline!.requestKeys();
|
||||||
if (room!.notificationCount > 0 &&
|
if (room!.hasNewMessages &&
|
||||||
timeline != null &&
|
timeline != null &&
|
||||||
timeline!.events.isNotEmpty &&
|
timeline!.events.isNotEmpty &&
|
||||||
Matrix.of(context).webHasFocus) {
|
Matrix.of(context).webHasFocus) {
|
||||||
|
@ -150,7 +150,7 @@ class ChatListItem extends StatelessWidget {
|
|||||||
final ownMessage =
|
final ownMessage =
|
||||||
room.lastEvent?.senderId == Matrix.of(context).client.userID;
|
room.lastEvent?.senderId == Matrix.of(context).client.userID;
|
||||||
final unread = room.isUnread || room.membership == Membership.invite;
|
final unread = room.isUnread || room.membership == Membership.invite;
|
||||||
final unreadBubbleSize = unread
|
final unreadBubbleSize = unread || room.hasNewMessages
|
||||||
? room.notificationCount > 0
|
? room.notificationCount > 0
|
||||||
? 20.0
|
? 20.0
|
||||||
: 14.0
|
: 14.0
|
||||||
@ -291,15 +291,18 @@ class ChatListItem extends StatelessWidget {
|
|||||||
curve: Curves.bounceInOut,
|
curve: Curves.bounceInOut,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 7),
|
padding: const EdgeInsets.symmetric(horizontal: 7),
|
||||||
height: unreadBubbleSize,
|
height: unreadBubbleSize,
|
||||||
width: room.notificationCount == 0 && !unread
|
width:
|
||||||
? 0
|
room.notificationCount == 0 && !unread && !room.hasNewMessages
|
||||||
: (unreadBubbleSize - 9) *
|
? 0
|
||||||
room.notificationCount.toString().length +
|
: (unreadBubbleSize - 9) *
|
||||||
9,
|
room.notificationCount.toString().length +
|
||||||
|
9,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: room.highlightCount > 0
|
color: room.highlightCount > 0
|
||||||
? Colors.red
|
? Colors.red
|
||||||
: Theme.of(context).primaryColor,
|
: room.notificationCount > 0
|
||||||
|
? Theme.of(context).primaryColor
|
||||||
|
: Theme.of(context).primaryColor.withAlpha(100),
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
|
@ -132,8 +132,8 @@ class StoriesHeader extends StatelessWidget {
|
|||||||
size: 100,
|
size: 100,
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
),
|
),
|
||||||
unread: room.notificationCount > 0 ||
|
unread: room.membership == Membership.invite ||
|
||||||
room.membership == Membership.invite,
|
room.hasNewMessages,
|
||||||
onPressed: () => _goToStoryAction(context, room.id),
|
onPressed: () => _goToStoryAction(context, room.id),
|
||||||
onLongPressed: () => _contextualActions(context, room),
|
onLongPressed: () => _contextualActions(context, room),
|
||||||
),
|
),
|
||||||
|
@ -832,7 +832,7 @@ packages:
|
|||||||
name: matrix
|
name: matrix
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.8.5"
|
version: "0.8.6"
|
||||||
matrix_api_lite:
|
matrix_api_lite:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -51,7 +51,7 @@ dependencies:
|
|||||||
intl: any
|
intl: any
|
||||||
localstorage: ^4.0.0+1
|
localstorage: ^4.0.0+1
|
||||||
lottie: ^1.2.1
|
lottie: ^1.2.1
|
||||||
matrix: ^0.8.5
|
matrix: ^0.8.6
|
||||||
matrix_link_text: ^1.0.2
|
matrix_link_text: ^1.0.2
|
||||||
open_noti_settings: ^0.4.0
|
open_noti_settings: ^0.4.0
|
||||||
package_info_plus: ^1.2.1
|
package_info_plus: ^1.2.1
|
||||||
|
Loading…
Reference in New Issue
Block a user