mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-13 20:57:12 +02:00
fix(stories): prevent rewatch indicator
This commit is contained in:
parent
0fdd7b576f
commit
00ad9cba6c
@ -2,7 +2,6 @@ package me.rhunk.snapenhance.core.features.impl
|
|||||||
|
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import me.rhunk.snapenhance.common.util.protobuf.ProtoEditor
|
import me.rhunk.snapenhance.common.util.protobuf.ProtoEditor
|
||||||
import me.rhunk.snapenhance.common.util.protobuf.ProtoReader
|
|
||||||
import me.rhunk.snapenhance.core.event.events.impl.NetworkApiRequestEvent
|
import me.rhunk.snapenhance.core.event.events.impl.NetworkApiRequestEvent
|
||||||
import me.rhunk.snapenhance.core.features.Feature
|
import me.rhunk.snapenhance.core.features.Feature
|
||||||
import me.rhunk.snapenhance.core.features.FeatureLoadParams
|
import me.rhunk.snapenhance.core.features.FeatureLoadParams
|
||||||
@ -35,10 +34,13 @@ class Stories : Feature("Stories", loadParams = FeatureLoadParams.INIT_SYNC) {
|
|||||||
}
|
}
|
||||||
if (!context.config.messaging.preventStoryRewatchIndicator.get()) return@subscribe
|
if (!context.config.messaging.preventStoryRewatchIndicator.get()) return@subscribe
|
||||||
event.hookRequestBuffer { buffer ->
|
event.hookRequestBuffer { buffer ->
|
||||||
if (ProtoReader(buffer).getVarInt(2, 7, 4) == 1L) {
|
ProtoEditor(buffer).apply {
|
||||||
cancelRequest()
|
edit {
|
||||||
}
|
get(2).removeIf {
|
||||||
buffer
|
it.toReader().getVarInt(7, 4) == 1L
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.toByteArray()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user