Do not render in-chat key verification requests in the timeline

A m.key.verification.request sent from a client that supports in-chat
verification carries a plain text body for clients that do not. Element X
has no msgtype of its own for it, so it fell through to OtherMessageType
and the timeline printed that body, telling the user their client does
not support in-chat key verification right after a verification they had
just completed.

Drop the event when building the timeline items, as Element X iOS does.
This commit is contained in:
hayaksi1
2026-08-17 03:44:53 +03:00
parent 23b75c3423
commit 39afaa1fe4
3 changed files with 67 additions and 2 deletions
@@ -128,4 +128,11 @@ sealed interface GalleryItemType {
data class OtherMessageType(
val msgType: String,
val body: String,
) : MessageType
) : MessageType {
/**
* A `m.key.verification.request` carries a body meant for clients that cannot handle in-chat
* verification, so it must not be rendered as a message.
*/
val isKeyVerificationRequest: Boolean
get() = msgType == "m.key.verification.request"
}