Skip to content

Commit

Permalink
minor fixes
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 0e4b89e commit ddef627
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ import android.database.Cursor
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable
import android.media.AudioFocusRequest
import android.media.AudioFormat
import android.media.AudioManager
import android.media.AudioRecord
import android.media.MediaMetadataRetriever
import android.media.MediaPlayer
import android.net.Uri
Expand Down Expand Up @@ -1637,16 +1633,20 @@ class ChatActivity :
if(index - i < 0){
break
}
if(index - i >= (adapter?.items?.size?: 0) ){
if(i == 0 || index - i >= (adapter?.items?.size?: 0) ){
continue
}
val curMsg = adapter?.items?.get(index - i)?.item
val curMsg = adapter?.items?.getOrNull(index - i)?.item
if(curMsg is ChatMessage) {
if(nextMessage == null && i > 0) {
nextMessage = curMsg as ChatMessage
}

if(curMsg.isVoiceMessage){
if(curMsg.selectedIndividualHashMap == null){
// WORKAROUND TO FETCH FILE INFO:
curMsg.getImageUrl()
}
val filename = curMsg.selectedIndividualHashMap!!["name"]
val file = File(context.cacheDir, filename!!)
if (!file.exists()) {
Expand Down

0 comments on commit ddef627

Please sign in to comment.