commit 130587e060265763c89f282fa0bc3865c030cc65
parent 2207b1a61d6470be891c62c61b79dbea4379019b
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date:   Sat, 27 May 2023 11:10:29 +0200

perf: unlimited snap view time

Diffstat:
Mapp/src/main/kotlin/me/rhunk/snapenhance/features/impl/extras/UnlimitedSnapViewTime.kt | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/features/impl/extras/UnlimitedSnapViewTime.kt b/app/src/main/kotlin/me/rhunk/snapenhance/features/impl/extras/UnlimitedSnapViewTime.kt @@ -22,11 +22,11 @@ class UnlimitedSnapViewTime : if (message.messageContent.contentType != ContentType.SNAP) return@hookConstructor with(message.messageContent) { + val mediaAttributes = ProtoReader(this.content).readPath(11, 5, 2) ?: return@hookConstructor + if (mediaAttributes.exists(6)) return@hookConstructor this.content = ProtoEditor(this.content).apply { edit(11, 5, 2) { - ProtoReader(this@with.content).getInt(11, 5, 2, 5)?.let { - writeConstant(5, it) - } + mediaAttributes.getInt(5)?.let { writeConstant(5, it) } writeBuffer(6, byteArrayOf()) } }.toByteArray()