diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/voice/VoiceNoteMediaController.kt b/app/src/main/java/org/thoughtcrime/securesms/components/voice/VoiceNoteMediaController.kt index 99e2cc47862..27d5bd2e148 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/voice/VoiceNoteMediaController.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/voice/VoiceNoteMediaController.kt @@ -314,7 +314,7 @@ class VoiceNoteMediaController(val activity: FragmentActivity, private var postp inner class PlaybackStateListener : Player.Listener { override fun onEvents(player: Player, events: Player.Events) { super.onEvents(player, events) - if (events.contains(Player.EVENT_PLAYBACK_STATE_CHANGED)) { + if (events.contains(Player.EVENT_PLAYBACK_STATE_CHANGED) || events.contains(Player.EVENT_IS_PLAYING_CHANGED)) { if (!isActivityResumed()) { return } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt index 5606abad743..ff7d7717eb7 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt @@ -3237,7 +3237,7 @@ class ConversationFragment : binding.conversationItemRecycler.suppressLayout(false) if (selectedConversationModel.audioUri != null) { - getVoiceNoteMediaController().resumePlayback(selectedConversationModel.audioUri, messageRecord.getId()) + getVoiceNoteMediaController().resumePlayback(selectedConversationModel.audioUri, messageRecord.id) } WindowUtil.setLightStatusBarFromTheme(requireActivity()) @@ -3307,12 +3307,12 @@ class ConversationFragment : } private fun MessageRecord.getAudioUriForLongClick(): Uri? { - val playbackState = getVoiceNoteMediaController().voiceNotePlaybackState.value - if (playbackState == null || !playbackState.isPlaying) { + if (!hasAudio()) { return null } - if (hasAudio() || !isMms) { + val playbackState = getVoiceNoteMediaController().voiceNotePlaybackState.value + if (playbackState == null || !playbackState.isPlaying) { return null }