mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-18 19:19:33 +01:00
fetches both previous and next voice messages
Signed-off-by: Giacomo Pacini <giacomopacini98@gmail.com>
This commit is contained in:
parent
6a598357fc
commit
deab1d10e1
@ -1633,13 +1633,16 @@ class ChatActivity :
|
||||
val index = adapter?.getMessagePositionById(id) ?: 0
|
||||
|
||||
var nextMessage : ChatMessage? = null
|
||||
for (i in 1..5) {
|
||||
for (i in -5..5) {
|
||||
if(index - i < 0){
|
||||
break
|
||||
}
|
||||
if(index - i >= (adapter?.items?.size?: 0) ){
|
||||
continue
|
||||
}
|
||||
val curMsg = adapter?.items?.get(index - i)?.item
|
||||
if(curMsg is ChatMessage) {
|
||||
if(nextMessage == null) {
|
||||
if(nextMessage == null && i > 0) {
|
||||
nextMessage = curMsg as ChatMessage
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user