Исправление работы доставки, прочтения сообщений

This commit is contained in:
Халимов Рустам
2026-04-20 22:17:29 +03:00
parent fc1cf1fd6e
commit 962323814c
13 changed files with 99 additions and 24 deletions
@@ -153,7 +153,8 @@ class ChatRepositoryImpl @Inject constructor(
Log.d(TAG, "Cached ${entities.size} messages")
}
messages.map { msg -> msg.toDomain(currentUserId, baseUrl).copy(isRead = true) }
// Используем корректную логику из маппера (readBy), а не принудительно true
messages.map { msg -> msg.toDomain(currentUserId, baseUrl) }
} catch (e: Exception) {
Log.e(TAG, "Fetch messages failed", e)
emptyList()
@@ -186,7 +187,7 @@ class ChatRepositoryImpl @Inject constructor(
mediaType = type.uppercase(),
mediaJson = "[]",
reactionsJson = "{}",
isRead = true, replyToId = replyToId,
isRead = false, replyToId = replyToId,
syncStatus = SyncStatus.SYNCING,
isDeletedLocally = false, isEditedLocally = false,
editedContent = null, lastUpdated = currentTime
@@ -243,7 +244,7 @@ class ChatRepositoryImpl @Inject constructor(
else -> MediaType.TEXT
},
reactions = emptyMap(),
isRead = true,
isRead = false,
isPinned = false,
isForwarded = false,
forwardedFromName = null,