feat: Optimize chat screen transitions by removing redundant animations for a smoother user experience

This commit is contained in:
k1ngsterr1
2026-01-13 18:36:17 +05:00
parent 435c07bf01
commit 4881024a9c
5 changed files with 128 additions and 111 deletions

View File

@@ -410,6 +410,23 @@ class MessageRepository private constructor(private val context: Context) {
}
}
/**
* Обновить онлайн-статус пользователя в диалоге
*/
suspend fun updateOnlineStatus(publicKey: String, isOnline: Boolean) {
val account = currentAccount ?: return
// Обновляем статус в базе
dialogDao.updateOnlineStatus(
account = account,
opponentKey = publicKey,
isOnline = if (isOnline) 1 else 0,
lastSeen = if (!isOnline) System.currentTimeMillis() else 0
)
android.util.Log.d("MessageRepository", "🟢 Updated online status for ${publicKey.take(16)}... isOnline=$isOnline")
}
// Extension functions
private fun MessageEntity.toMessage(): Message {
// 🔓 Расшифровываем plainMessage с использованием приватного ключа