feat: Add VerifiedBadge and online status to user profile header

This commit is contained in:
k1ngsterr1
2026-01-25 18:43:40 +05:00
parent efd666ee41
commit 37acbfeef6
3 changed files with 74 additions and 14 deletions

View File

@@ -613,6 +613,22 @@ class MessageRepository private constructor(private val context: Context) {
}
/**
* Наблюдать за онлайн статусом пользователя
*/
fun observeUserOnlineStatus(publicKey: String): Flow<Pair<Boolean, Long>> {
val account = currentAccount ?: return flowOf(false to 0L)
return dialogDao.observeOnlineStatus(account, publicKey)
.map { info ->
if (info != null) {
(info.isOnline == 1) to info.lastSeen
} else {
false to 0L
}
}
}
/**
* Обновить информацию о пользователе в диалоге (имя, username, verified)
* Вызывается когда приходит ответ на PacketSearch