commit a936f1fbc7e118c843263a082a849d7ba8ef8ff2 parent 407e69d184b7e1759d00ea9277455374657d4838 Author: rhunk <101876869+rhunk@users.noreply.github.com> Date: Tue, 31 Oct 2023 01:09:49 +0100 feat(core/e2ee): native hooks warning Diffstat:
M | core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/experiments/EndToEndEncryption.kt | | | 7 | +++++++ |
1 file changed, 7 insertions(+), 0 deletions(-)
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 @@ -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