mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 12:44:38 +00:00
Ensure messages are marked read when entering a conversation with an active typing indicator.
This commit is contained in:
@@ -416,7 +416,7 @@ public class ConversationAdapter
|
||||
}
|
||||
|
||||
boolean hasNoConversationMessages() {
|
||||
return getItemCount() + fastRecords.size() == 0;
|
||||
return super.getItemCount() + fastRecords.size() == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1279,17 +1279,19 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
||||
return;
|
||||
}
|
||||
|
||||
if (position >= (isTypingIndicatorShowing() ? 1 : 0)) {
|
||||
ConversationMessage item = getListAdapter().getItem(position);
|
||||
if (item != null) {
|
||||
MessageRecord record = item.getMessageRecord();
|
||||
long latestReactionReceived = Stream.of(record.getReactions())
|
||||
.map(ReactionRecord::getDateReceived)
|
||||
.max(Long::compareTo)
|
||||
.orElse(0L);
|
||||
ConversationMessage item = getListAdapter().getItem(position);
|
||||
if (item == null) {
|
||||
item = getListAdapter().getItem(position + 1);
|
||||
}
|
||||
|
||||
markReadHelper.onViewsRevealed(Math.max(record.getDateReceived(), latestReactionReceived));
|
||||
}
|
||||
if (item != null) {
|
||||
MessageRecord record = item.getMessageRecord();
|
||||
long latestReactionReceived = Stream.of(record.getReactions())
|
||||
.map(ReactionRecord::getDateReceived)
|
||||
.max(Long::compareTo)
|
||||
.orElse(0L);
|
||||
|
||||
markReadHelper.onViewsRevealed(Math.max(record.getDateReceived(), latestReactionReceived));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user