From bfd2686610df5c49338512f0f992b9465d434c5e Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Tue, 11 Oct 2022 10:29:18 -0400 Subject: [PATCH] Fix issue where some threads were invisibly unread. Problem 1: We weren't marking threads read when we shared into them. Problem 2: We hid the unread status of threads whose last message was outgoing. This addresses both. It's possible that 'fixing' problem 2 could result in more threads being marked as read, but really that should just make us aware so we can properly mark the thread as read. --- .../securesms/conversationlist/ConversationListItem.java | 2 +- .../org/thoughtcrime/securesms/sharing/MultiShareSender.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListItem.java b/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListItem.java index 50fb3ef2d6..1fd3f28d46 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListItem.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListItem.java @@ -462,7 +462,7 @@ public final class ConversationListItem extends ConstraintLayout implements Bind } private void setUnreadIndicator(ThreadRecord thread) { - if ((thread.isOutgoing() && !thread.isForcedUnread()) || thread.isRead()) { + if (thread.isRead()) { unreadIndicator.setVisibility(View.GONE); return; } diff --git a/app/src/main/java/org/thoughtcrime/securesms/sharing/MultiShareSender.java b/app/src/main/java/org/thoughtcrime/securesms/sharing/MultiShareSender.java index e007440751..8a3d7a251b 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/sharing/MultiShareSender.java +++ b/app/src/main/java/org/thoughtcrime/securesms/sharing/MultiShareSender.java @@ -156,6 +156,10 @@ public final class MultiShareSender { results.add(new MultiShareSendResult(recipientSearchKey, MultiShareSendResult.Type.SUCCESS)); } + if (!recipientSearchKey.isStory()) { + SignalDatabase.threads().setRead(threadId, true); + } + // XXX We must do this to avoid sending out messages to the same recipient with the same // sentTimestamp. If we do this, they'll be considered dupes by the receiver. ThreadUtil.sleep(5);