minor cleanup

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-08-09 15:39:52 +02:00
parent 6a3ece6703
commit beb7b150be
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -193,8 +193,6 @@ class OfflineFirstChatRepository @Inject constructor(
networkParams.putSerializable(BundleKeys.KEY_FIELD_MAP, fieldMap)
val resultsFromSync = sync(networkParams)
Log.d(TAG, "got result from longpolling")
if (!resultsFromSync.isNullOrEmpty()) {
val chatMessages = resultsFromSync.map(ChatMessageEntity::asModel)
val pair = Pair(true, chatMessages)
@ -203,18 +201,6 @@ class OfflineFirstChatRepository @Inject constructor(
updateUiForLastCommonRead(0)
// Process read status if not null
// val lastKnown = datastore.getLastKnownId(internalConversationId, 0)
// list = list.map { chatMessage ->
// chatMessage.readStatus = if (chatMessage.jsonMessageId <= lastKnown) {
// ReadStatus.READ
// } else {
// ReadStatus.SENT
// }
//
// return@map chatMessage
// }
val newestMessage = chatDao.getNewestMessageId(internalConversationId).toInt()
// update field map vars for next cycle