From f08a20d0a605727d1aec2104ec9c48f7ab6875f6 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Fri, 12 Jun 2026 13:28:16 +0000 Subject: [PATCH] Render unread divider when the only unread message is the newest in the thread. --- .../securesms/conversation/ConversationRepository.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationRepository.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationRepository.java index e22c8709b2..257a4b4b02 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationRepository.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationRepository.java @@ -65,10 +65,8 @@ public class ConversationRepository { firstUnreadPosition = SignalDatabase.messages().getMessagePositionByDateReceivedTimestamp(threadId, firstUnreadDateReceived, false); } - if (firstUnreadPosition <= 0) { - firstUnreadId = -1; - firstUnreadDateReceived = 0; - } + // A position of 0 means the oldest unread message is the newest message in the thread (e.g. a single unread). That + // is a valid divider anchor, so we keep firstUnreadId; it just means we don't scroll up to reach it. if (firstUnreadDateReceived == 0 && lastScrolled > 0) { lastScrolledPosition = SignalDatabase.messages().getMessagePositionByDateReceivedTimestamp(threadId, lastScrolled, true);