element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
GNU Affero General Public License v3.0
3.39k stars 730 forks source link

How to get latest timelineevent from room inside roomlist #5077

Open hafiz013 opened 2 years ago

hafiz013 commented 2 years ago

Your use case

So far in order to get latest evet from room inside room list is using roomsummary (latestPreviewableEvent). However, latestPreviewableEvent sometimes become null and not give the latest event that particular chat (room). So how to get latest event?tq

Have you considered any alternatives?

No response

Additional context

No response

ouchadam commented 2 years ago

from my understanding this could happen if the latest event has a type that is no previewable https://github.com/vector-im/element-android/blob/develop/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/summary/RoomSummaryConstants.kt#L26

do you have a sample to reproduce the issue?