tinode / ios

Tinodios: Tinode Messaging Client for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When loading older messages, keep MessageVC at the top of the message list

aforge opened this issue · comments

When the user opens a chat, Tinodios loads the latest 24 messages by default.
In order to load older messages in a chat (in the MessageVC), the user scrolls the message list
to the top (by swiping down the message list) and upon reaching the top swipes it down once again - which triggers the loading logic.
However, upon loading a batch of older messages (from either local storage or, if not available locally, from the server) the MessageVC always scrolls down the message list all the way to bottom.
It is annoying because in order to get to the newly loaded messages the user must scroll all the way up through the message list again.

Describe the solution you'd like
Upon loading older messages, keep the MessageVC at the top of the message list.

Additional context
See logic in https://github.com/tinode/ios/blob/devel/Tinodios/MessageViewController.swift, https://github.com/tinode/ios/blob/devel/Tinodios/MessageInteractor.swift and https://github.com/tinode/ios/blob/devel/Tinodios/MessagePresenter.swift

commented

This is fixed.