Closed Fra078 closed 1 year ago
lastReadOutboxMessageId
shouldn't be used to determine chat opening position. Use just lastReadInboxMessageId
and skip returned outgoing messages right after the lastReadInboxMessageId
if any.
The lastReadOutboxMessageId
and lastReadInboxMessageId
are just identifiers, before which all messages are read. There could be no corresponding message.
But if I use these variables also to determine where I have to display the Text (Unread messages) so I have to use both to avoid putting outbox messages under this text. wouldn't it be better to insert a variable like "lastReadMessageId"?
You always open the chat from lastReadInboxMessageId
and to place the bar correctly you need to skip outgoing messages after the last read inbox position. The skipped outgoing messages may or may not be read by peers, so it is useless to check lastReadOutboxMessageId
.
Channels where you can't send messages have lastReadOutboxMessageId very high so trying to display in a message list the max between lastReadOutboxMessageId and lastReadInboxMessageId result always as lastReadOutboxMessageId. So the message list starts always from the bottom