From a936f1fbc7e118c843263a082a849d7ba8ef8ff2 Mon Sep 17 00:00:00 2001 From: rhunk <101876869+rhunk@users.noreply.github.com> Date: Tue, 31 Oct 2023 01:09:49 +0100 Subject: [PATCH] feat(core/e2ee): native hooks warning --- .../core/features/impl/experiments/EndToEndEncryption.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/experiments/EndToEndEncryption.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/experiments/EndToEndEncryption.kt index d6dc05b1..1d4d1b45 100644 --- a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/experiments/EndToEndEncryption.kt +++ b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/experiments/EndToEndEncryption.kt @@ -33,6 +33,7 @@ import me.rhunk.snapenhance.core.util.EvictingMap import me.rhunk.snapenhance.core.util.ktx.getObjectField import me.rhunk.snapenhance.core.wrapper.impl.MessageContent import me.rhunk.snapenhance.core.wrapper.impl.SnapUUID +import me.rhunk.snapenhance.nativelib.NativeLib import java.security.MessageDigest import kotlin.random.Random @@ -393,6 +394,12 @@ class EndToEndEncryption : MessagingRuleFeature( return@subscribe } + if (!NativeLib.initialized) { + context.longToast("Failed to send! Please enable Native Hooks in the settings.") + event.canceled = true + return@subscribe + } + event.addInvokeLater { if (messageContent.contentType == ContentType.SNAP) { messageContent.contentType = ContentType.EXTERNAL_MEDIA