Skip to content

Commit

Permalink
fetches both previous and next voice messages
Browse files Browse the repository at this point in the history
Signed-off-by: Giacomo Pacini <[email protected]>
  • Loading branch information
Ruggero1912 committed Dec 16, 2024
1 parent d7a82f8 commit 0e4b89e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 0e4b89e

Please sign in to comment.