"Mark as unread" dot appears on rooms that are actually unread, not marked as such (#7352)

* fix green dot only to appear for marked action
This commit is contained in:
Flescio 2023-02-09 09:01:16 +01:00 committed by GitHub
parent 50f1fc8743
commit 1f8f6ffdf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 8 deletions

View file

@ -92,12 +92,17 @@
self.lastEventDecriptionLabelTrailingConstraint.constant = self.unsentImageView.hidden ? 10 : 30;
// Notify unreads and bing
if (roomCellData.hasUnread)
if (roomCellData.isRoomMarkedAsUnread)
{
self.missedNotifAndUnreadBadgeBgView.hidden = NO;
self.missedNotifAndUnreadBadgeBgView.backgroundColor = ThemeService.shared.theme.tintColor;
self.missedNotifAndUnreadBadgeBgViewWidthConstraint.constant = 20;
}
else if (roomCellData.hasUnread)
{
self.missedNotifAndUnreadIndicator.hidden = NO;
if (0 < roomCellData.notificationCount)
{
self.missedNotifAndUnreadIndicator.hidden = NO;
self.missedNotifAndUnreadIndicator.backgroundColor = roomCellData.highlightCount ? ThemeService.shared.theme.noticeColor : ThemeService.shared.theme.noticeSecondaryColor;
self.missedNotifAndUnreadBadgeBgView.hidden = NO;
@ -110,9 +115,7 @@
}
else
{
self.missedNotifAndUnreadBadgeBgView.hidden = NO;
self.missedNotifAndUnreadBadgeBgView.backgroundColor = ThemeService.shared.theme.tintColor;
self.missedNotifAndUnreadBadgeBgViewWidthConstraint.constant = 20;
self.missedNotifAndUnreadIndicator.backgroundColor = ThemeService.shared.theme.unreadRoomIndentColor;
}
// Use bold font for the room title

View file

@ -63,8 +63,12 @@
- (BOOL)hasUnread
{
bool isRoomUnread = [[self mxSession] isRoomMarkedAsUnread:roomSummary.roomId];
return (roomSummary.localUnreadEventCount != 0 || isRoomUnread);
return (roomSummary.localUnreadEventCount != 0);
}
- (BOOL)isRoomMarkedAsUnread
{
return [[self mxSession] isRoomMarkedAsUnread:roomSummary.roomId];;
}
- (NSString *)roomIdentifier

View file

@ -50,6 +50,7 @@
@property (nonatomic, readonly) NSString *lastEventDate;
@property (nonatomic, readonly) BOOL hasUnread;
@property (nonatomic, readonly) BOOL isRoomMarkedAsUnread;
@property (nonatomic, readonly) NSUInteger notificationCount;
@property (nonatomic, readonly) NSUInteger highlightCount;
@property (nonatomic, readonly) NSString *notificationCountStringValue;

1
changelog.d/7530.bugfix Normal file
View file

@ -0,0 +1 @@
Fixes #7350 - Fix green dot only to appear for marked action