refactor(chat): single owner for display kinds and REST row ids (#1364)

This commit is contained in:
m57
2026-09-28 20:26:13 +03:00
committed by GitHub
parent 9aefc5bfc7
commit 12ddef09a0
11 changed files with 107 additions and 33 deletions
@@ -66,7 +66,9 @@ internal fun canonicalMessageOrder(
id: String,
sessionId: String,
): Long? {
val prefix = "rest-$sessionId-"
val prefix =
com.m57.hermescontrol.ui.chat.RestMessageId
.sessionPrefix(sessionId)
if (!id.startsWith(prefix)) return null
val suffix = id.removePrefix(prefix)
return suffix.takeIf { it.isNotEmpty() && it.all { char -> char in '0'..'9' } }?.toLongOrNull()