feat: Optimize chat screen transitions by removing redundant animations for a smoother user experience
This commit is contained in:
@@ -97,6 +97,23 @@ object ProtocolManager {
|
||||
}
|
||||
}
|
||||
|
||||
// 🟢 Обработчик онлайн-статуса (0x05)
|
||||
waitPacket(0x05) { packet ->
|
||||
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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Обработчик typing (0x0B)
|
||||
waitPacket(0x0B) { packet ->
|
||||
val typingPacket = packet as PacketTyping
|
||||
@@ -109,6 +126,20 @@ 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user