PacketRead parity: корректные read-статусы и update release notes 1.3.0
Some checks failed
Android Kernel Build / build (push) Failing after 10m41s
Some checks failed
Android Kernel Build / build (push) Failing after 10m41s
This commit is contained in:
@@ -975,20 +975,24 @@ class MessageRepository private constructor(private val context: Context) {
|
|||||||
|
|
||||||
val readCount =
|
val readCount =
|
||||||
messageCache[dialogKey]?.value?.count {
|
messageCache[dialogKey]?.value?.count {
|
||||||
it.isFromMe &&
|
it.isFromMe && !it.isRead
|
||||||
!it.isRead &&
|
|
||||||
(it.deliveryStatus == DeliveryStatus.DELIVERED ||
|
|
||||||
it.deliveryStatus == DeliveryStatus.READ)
|
|
||||||
} ?: 0
|
} ?: 0
|
||||||
messageCache[dialogKey]?.let { flow ->
|
messageCache[dialogKey]?.let { flow ->
|
||||||
flow.value =
|
flow.value =
|
||||||
flow.value.map { msg ->
|
flow.value.map { msg ->
|
||||||
if (msg.isFromMe &&
|
if (msg.isFromMe && !msg.isRead) {
|
||||||
!msg.isRead &&
|
msg.copy(
|
||||||
(msg.deliveryStatus == DeliveryStatus.DELIVERED ||
|
isRead = true,
|
||||||
msg.deliveryStatus == DeliveryStatus.READ)
|
deliveryStatus =
|
||||||
) {
|
if (
|
||||||
msg.copy(isRead = true, deliveryStatus = DeliveryStatus.READ)
|
msg.deliveryStatus == DeliveryStatus.DELIVERED ||
|
||||||
|
msg.deliveryStatus == DeliveryStatus.READ
|
||||||
|
) {
|
||||||
|
DeliveryStatus.READ
|
||||||
|
} else {
|
||||||
|
msg.deliveryStatus
|
||||||
|
}
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
msg
|
msg
|
||||||
}
|
}
|
||||||
@@ -1026,20 +1030,24 @@ class MessageRepository private constructor(private val context: Context) {
|
|||||||
|
|
||||||
val readCount =
|
val readCount =
|
||||||
messageCache[dialogKey]?.value?.count {
|
messageCache[dialogKey]?.value?.count {
|
||||||
it.isFromMe &&
|
it.isFromMe && !it.isRead
|
||||||
!it.isRead &&
|
|
||||||
(it.deliveryStatus == DeliveryStatus.DELIVERED ||
|
|
||||||
it.deliveryStatus == DeliveryStatus.READ)
|
|
||||||
} ?: 0
|
} ?: 0
|
||||||
messageCache[dialogKey]?.let { flow ->
|
messageCache[dialogKey]?.let { flow ->
|
||||||
flow.value =
|
flow.value =
|
||||||
flow.value.map { msg ->
|
flow.value.map { msg ->
|
||||||
if (msg.isFromMe &&
|
if (msg.isFromMe && !msg.isRead) {
|
||||||
!msg.isRead &&
|
msg.copy(
|
||||||
(msg.deliveryStatus == DeliveryStatus.DELIVERED ||
|
isRead = true,
|
||||||
msg.deliveryStatus == DeliveryStatus.READ)
|
deliveryStatus =
|
||||||
) {
|
if (
|
||||||
msg.copy(isRead = true, deliveryStatus = DeliveryStatus.READ)
|
msg.deliveryStatus == DeliveryStatus.DELIVERED ||
|
||||||
|
msg.deliveryStatus == DeliveryStatus.READ
|
||||||
|
) {
|
||||||
|
DeliveryStatus.READ
|
||||||
|
} else {
|
||||||
|
msg.deliveryStatus
|
||||||
|
}
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
msg
|
msg
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ object ReleaseNotes {
|
|||||||
- Исправлена нормализация дубликатов своих сообщений из sync: локальные WAITING/ERROR теперь автоматически переходят в DELIVERED
|
- Исправлена нормализация дубликатов своих сообщений из sync: локальные WAITING/ERROR теперь автоматически переходят в DELIVERED
|
||||||
- Добавлен watchdog для sync-запроса: если ответ на PacketSync завис, запрос перезапускается автоматически
|
- Добавлен watchdog для sync-запроса: если ответ на PacketSync завис, запрос перезапускается автоматически
|
||||||
- Повышена стабильность цикла BATCH_START/BATCH_END/NOT_NEEDED при reconnect
|
- Повышена стабильность цикла BATCH_START/BATCH_END/NOT_NEEDED при reconnect
|
||||||
|
- Исправлена обработка PacketRead: read-статусы теперь ставятся как в desktop/wss, включая сценарии когда read приходит раньше delivery
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
fun getNotice(version: String): String =
|
fun getNotice(version: String): String =
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ interface MessageDao {
|
|||||||
WHERE account = :account
|
WHERE account = :account
|
||||||
AND to_public_key = :opponent
|
AND to_public_key = :opponent
|
||||||
AND from_me = 1
|
AND from_me = 1
|
||||||
AND delivered IN (1, 3)
|
AND read != 1
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
suspend fun markAllAsRead(account: String, opponent: String): Int
|
suspend fun markAllAsRead(account: String, opponent: String): Int
|
||||||
|
|||||||
Reference in New Issue
Block a user