feat: Refactor message bubble layout to display timestamp and status inline for outgoing messages

This commit is contained in:
k1ngsterr1
2026-01-13 20:14:39 +05:00
parent a7576865ef
commit 7c911835ea
4 changed files with 105 additions and 94 deletions

View File

@@ -102,14 +102,11 @@ object ProtocolManager {
val onlinePacket = packet as PacketOnlineState
addLog("🟢 Online status received: ${onlinePacket.publicKeysState.size} entries")
onlinePacket.publicKeysState.forEach { item ->
addLog(" User ${item.publicKey.take(16)}... is ${item.state}")
scope.launch {
messageRepository?.updateOnlineStatus(
publicKey = item.publicKey,
isOnline = item.state == OnlineState.ONLINE
)
scope.launch {
onlinePacket.publicKeysState.forEach { item ->
val isOnline = item.state == OnlineState.ONLINE
addLog(" ${item.publicKey.take(16)}... -> ${if (isOnline) "ONLINE" else "OFFLINE"}")
messageRepository?.updateOnlineStatus(item.publicKey, isOnline)
}
}
}
@@ -126,20 +123,6 @@ object ProtocolManager {
_typingUsers.value = _typingUsers.value - typingPacket.fromPublicKey
}
}
// 🟢 Обработчик онлайн статуса (0x05)
waitPacket(0x05) { packet ->
val onlinePacket = packet as PacketOnlineState
addLog("🟢 Online status received: ${onlinePacket.publicKeysState.size} entries")
scope.launch {
onlinePacket.publicKeysState.forEach { item ->
val isOnline = item.state == OnlineState.ONLINE
addLog(" ${item.publicKey.take(16)}... -> ${if (isOnline) "ONLINE" else "OFFLINE"}")
messageRepository?.updateOnlineStatus(item.publicKey, isOnline)
}
}
}
}
/**