commit 51869e56a86a9fcd75d80f9db3bf565978c8e03e parent 8533bb95d36c0d21ee26d79b02ab14dff16de856 Author: rhunk <101876869+rhunk@users.noreply.github.com> Date: Wed, 1 May 2024 01:34:33 +0200 fix(core/unsaveable_message): content type check Diffstat:
M | core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/tweaks/UnsaveableMessages.kt | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/tweaks/UnsaveableMessages.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/tweaks/UnsaveableMessages.kt @@ -34,9 +34,9 @@ class UnsaveableMessages : MessagingRuleFeature( event.buffer = ProtoEditor(event.buffer).apply { edit(4) { val contentType = firstOrNull(2)?.value - if (contentType != ContentType.STATUS.id.toLong()) { + if (contentType != ContentType.STATUS.id.toLong() && firstOrNull(4)?.toReader()?.contains(11) != true) { remove(7) - addVarInt(7, if (contentType != ContentType.SNAP.id) 3 else 1) // set savePolicy to PROHIBITED only for snaps + addVarInt(7, 3) // set savePolicy to VIEW_SESSION except for status and snaps } } }.toByteArray()