From ec12980571f5e53aa503d2a49f41a48f260351a5 Mon Sep 17 00:00:00 2001 From: rhunk <101876869+rhunk@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:04:42 +0100 Subject: [PATCH] fix(core): old bitmoji selfie --- .../snapenhance/core/features/impl/ui/OldBitmojiSelfie.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ui/OldBitmojiSelfie.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ui/OldBitmojiSelfie.kt index 5cf76b00..156ba508 100644 --- a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ui/OldBitmojiSelfie.kt +++ b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ui/OldBitmojiSelfie.kt @@ -15,6 +15,9 @@ class OldBitmojiSelfie : Feature("OldBitmojiSelfie", loadParams = FeatureLoadPar if (urlPrefixes.firstOrNull { event.url.startsWith(it) } == null) return@subscribe event.url = event.url.replace("ua=1", "") // replace ua=1 with nothing for old 3d selfies/background + if (oldBitmojiSelfie == "2d" && event.url.contains("ua=")) { + event.url = event.url.replace(Regex("ua=[^&]+"), "ua=0") + } // replace with old 2d selfies if (oldBitmojiSelfie == "2d" && event.url.contains("trim=circle")) { val bitmojiPath = event.url.substringAfterLast("/").substringBeforeLast("?")