Skip to content

Commit

Permalink
fix(voice_note_override): content type check
Browse files Browse the repository at this point in the history
  • Loading branch information
rhunk committed Aug 12, 2024
1 parent 2f30079 commit 7f5e76d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package me.rhunk.snapenhance.core.features.impl.tweaks
import android.view.ViewGroup
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import me.rhunk.snapenhance.common.data.ContentType
import me.rhunk.snapenhance.core.SnapEnhance
import me.rhunk.snapenhance.core.event.events.impl.BindViewEvent
import me.rhunk.snapenhance.core.features.Feature
Expand Down Expand Up @@ -140,6 +141,8 @@ class VoiceNoteOverride: Feature("Voice Note Override") {
val composerContext = composerRootView.getComposerContext() ?: return@subscribe
val playbackViewComponentContext = composerContext.componentContext?.get() ?: return@subscribe

if (event.databaseMessage?.contentType != ContentType.NOTE.id) return@subscribe

val serverMessageId = event.databaseMessage?.serverMessageId?.toLong() ?: return@subscribe

synchronized(playbackMap) {
Expand Down

0 comments on commit 7f5e76d

Please sign in to comment.