Skip to content

Commit 068bc2d

Browse files
committed
only move the unread counter up
1 parent c122538 commit 068bc2d

File tree

1 file changed

+2
-2
lines changed
  • Signal-Windows.Lib/Storage

1 file changed

+2
-2
lines changed

Signal-Windows.Lib/Storage/DB.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ internal static void UpdateMessageRead(long index, SignalConversation conversati
10001000
if (contact != null)
10011001
{
10021002
contact.LastSeenMessageIndex = index;
1003-
contact.UnreadCount = (uint)(contact.MessagesCount - index);
1003+
contact.UnreadCount = Math.Max(contact.UnreadCount, (uint)(contact.MessagesCount - index));
10041004
}
10051005
}
10061006
else
@@ -1011,7 +1011,7 @@ internal static void UpdateMessageRead(long index, SignalConversation conversati
10111011
if (group != null)
10121012
{
10131013
group.LastSeenMessageIndex = index;
1014-
group.UnreadCount = (uint)(group.MessagesCount - index);
1014+
group.UnreadCount = Math.Max(group.UnreadCount, (uint)(group.MessagesCount - index));
10151015
}
10161016
}
10171017
ctx.SaveChanges();

0 commit comments

Comments
 (0)