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.
This commit is contained in:
Greyson Parrelli
2022-10-11 10:29:18 -04:00
parent c131fb500d
commit bfd2686610
2 changed files with 5 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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);