feat: Enhance ProtocolManager logging and error handling; optimize emoji picker performance

This commit is contained in:
k1ngsterr1
2026-01-13 20:46:46 +05:00
parent 7c911835ea
commit f155c4d36d
4 changed files with 116 additions and 80 deletions

View File

@@ -103,10 +103,17 @@ object ProtocolManager {
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)
if (messageRepository == null) {
addLog("❌ ERROR: messageRepository is NULL!")
} else {
addLog("messageRepository is initialized")
onlinePacket.publicKeysState.forEach { item ->
val isOnline = item.state == OnlineState.ONLINE
addLog(" ${item.publicKey.take(16)}... -> ${if (isOnline) "ONLINE" else "OFFLINE"}")
addLog(" Calling updateOnlineStatus...")
messageRepository?.updateOnlineStatus(item.publicKey, isOnline)
addLog(" updateOnlineStatus called")
}
}
}
}