feat: Add VerifiedBadge and online status to user profile header
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user