mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-13 05:37:48 +02:00
feat: remove custom story expiration
This commit is contained in:
@ -524,10 +524,6 @@
|
|||||||
"name": "Infinite Story Boost",
|
"name": "Infinite Story Boost",
|
||||||
"description": "Bypass the Story Boost Limit delay"
|
"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": {
|
"meo_passcode_bypass": {
|
||||||
"name": "My Eyes Only 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"
|
"description": "Bypass the My Eyes Only passcode\nThis will only work if the passcode has been entered correctly before"
|
||||||
|
@ -14,7 +14,6 @@ class Experimental : ConfigContainer() {
|
|||||||
val appPasscode = string("app_passcode")
|
val appPasscode = string("app_passcode")
|
||||||
val appLockOnResume = boolean("app_lock_on_resume")
|
val appLockOnResume = boolean("app_lock_on_resume")
|
||||||
val infiniteStoryBoost = boolean("infinite_story_boost")
|
val infiniteStoryBoost = boolean("infinite_story_boost")
|
||||||
val customStoryExpiration = integer("custom_story_expiration") { requireRestart(); nativeHooks() }
|
|
||||||
val meoPasscodeBypass = boolean("meo_passcode_bypass")
|
val meoPasscodeBypass = boolean("meo_passcode_bypass")
|
||||||
val unlimitedMultiSnap = boolean("unlimited_multi_snap") { addNotices(FeatureNotice.BAN_RISK)}
|
val unlimitedMultiSnap = boolean("unlimited_multi_snap") { addNotices(FeatureNotice.BAN_RISK)}
|
||||||
val noFriendScoreDelay = boolean("no_friend_score_delay") { requireRestart()}
|
val noFriendScoreDelay = boolean("no_friend_score_delay") { requireRestart()}
|
||||||
|
@ -11,7 +11,6 @@ import me.rhunk.snapenhance.core.features.FeatureLoadParams
|
|||||||
import me.rhunk.snapenhance.core.messaging.MessageSender
|
import me.rhunk.snapenhance.core.messaging.MessageSender
|
||||||
import me.rhunk.snapenhance.core.ui.ViewAppearanceHelper
|
import me.rhunk.snapenhance.core.ui.ViewAppearanceHelper
|
||||||
import me.rhunk.snapenhance.nativelib.NativeLib
|
import me.rhunk.snapenhance.nativelib.NativeLib
|
||||||
import kotlin.math.absoluteValue
|
|
||||||
|
|
||||||
class SendOverride : Feature("Send Override", loadParams = FeatureLoadParams.INIT_SYNC) {
|
class SendOverride : Feature("Send Override", loadParams = FeatureLoadParams.INIT_SYNC) {
|
||||||
private var isLastSnapSavable = false
|
private var isLastSnapSavable = false
|
||||||
@ -34,18 +33,6 @@ class SendOverride : Feature("Send Override", loadParams = FeatureLoadParams.INI
|
|||||||
if (event.uri != "/messagingcoreservice.MessagingCoreService/CreateContentMessage") return@subscribe
|
if (event.uri != "/messagingcoreservice.MessagingCoreService/CreateContentMessage") return@subscribe
|
||||||
val protoEditor = ProtoEditor(event.buffer)
|
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)) {
|
if (isLastSnapSavable && ProtoReader(event.buffer).containsPath(*Constants.ARROYO_MEDIA_CONTAINER_PROTO_PATH, 11)) {
|
||||||
protoEditor.edit(*Constants.ARROYO_MEDIA_CONTAINER_PROTO_PATH, 11, 5, 2) {
|
protoEditor.edit(*Constants.ARROYO_MEDIA_CONTAINER_PROTO_PATH, 11, 5, 2) {
|
||||||
remove(8)
|
remove(8)
|
||||||
|
Reference in New Issue
Block a user