From 095020d8f8ca6c9f1807942e59e3b03b4b86362d Mon Sep 17 00:00:00 2001 From: rhunk <101876869+rhunk@users.noreply.github.com> Date: Fri, 27 Oct 2023 01:38:45 +0200 Subject: [PATCH] feat: remove custom story expiration --- common/src/main/assets/lang/en_US.json | 4 ---- .../snapenhance/common/config/impl/Experimental.kt | 1 - .../core/features/impl/messaging/SendOverride.kt | 13 ------------- 3 files changed, 18 deletions(-) diff --git a/common/src/main/assets/lang/en_US.json b/common/src/main/assets/lang/en_US.json index c6fad90c..52219a1b 100644 --- a/common/src/main/assets/lang/en_US.json +++ b/common/src/main/assets/lang/en_US.json @@ -524,10 +524,6 @@ "name": "Infinite Story Boost", "description": "Bypass the Story Boost Limit delay" }, - "custom_story_expiration": { - "name": "Custom Story Expiration", - "description": "Set a custom story expiration time in hours (0 to disable)" - }, "meo_passcode_bypass": { "name": "My Eyes Only Passcode Bypass", "description": "Bypass the My Eyes Only passcode\nThis will only work if the passcode has been entered correctly before" diff --git a/common/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/Experimental.kt b/common/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/Experimental.kt index 2ccb2a5a..481f57d7 100644 --- a/common/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/Experimental.kt +++ b/common/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/Experimental.kt @@ -14,7 +14,6 @@ class Experimental : ConfigContainer() { val appPasscode = string("app_passcode") val appLockOnResume = boolean("app_lock_on_resume") val infiniteStoryBoost = boolean("infinite_story_boost") - val customStoryExpiration = integer("custom_story_expiration") { requireRestart(); nativeHooks() } val meoPasscodeBypass = boolean("meo_passcode_bypass") val unlimitedMultiSnap = boolean("unlimited_multi_snap") { addNotices(FeatureNotice.BAN_RISK)} val noFriendScoreDelay = boolean("no_friend_score_delay") { requireRestart()} diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/messaging/SendOverride.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/messaging/SendOverride.kt index a3996ab4..52d7a453 100644 --- a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/messaging/SendOverride.kt +++ b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/messaging/SendOverride.kt @@ -11,7 +11,6 @@ import me.rhunk.snapenhance.core.features.FeatureLoadParams import me.rhunk.snapenhance.core.messaging.MessageSender import me.rhunk.snapenhance.core.ui.ViewAppearanceHelper import me.rhunk.snapenhance.nativelib.NativeLib -import kotlin.math.absoluteValue class SendOverride : Feature("Send Override", loadParams = FeatureLoadParams.INIT_SYNC) { private var isLastSnapSavable = false @@ -34,18 +33,6 @@ class SendOverride : Feature("Send Override", loadParams = FeatureLoadParams.INI if (event.uri != "/messagingcoreservice.MessagingCoreService/CreateContentMessage") return@subscribe val protoEditor = ProtoEditor(event.buffer) - context.config.experimental.customStoryExpiration.get().takeIf { it > 0 }?.absoluteValue?.also { expirationInHours -> - protoEditor.edit(3, 2, 2) { - remove(1) - add(1) { - from(2) { - addVarInt(1, expirationInHours) - context.log.verbose("add story expiration to $expirationInHours hours") - } - } - } - } - if (isLastSnapSavable && ProtoReader(event.buffer).containsPath(*Constants.ARROYO_MEDIA_CONTAINER_PROTO_PATH, 11)) { protoEditor.edit(*Constants.ARROYO_MEDIA_CONTAINER_PROTO_PATH, 11, 5, 2) { remove(8)