This commit is contained in:
Benoit Marty 2021-03-12 12:16:25 +01:00 committed by Benoit Marty
parent 0b0634b531
commit 857bfcb971
3 changed files with 4 additions and 6 deletions

View file

@ -5,7 +5,7 @@ Features ✨:
-
Improvements 🙌:
-
- Lazy storage of ReadReceipts
Bugfix 🐛:
-

View file

@ -121,13 +121,11 @@ internal class ReadReceiptHandler @Inject constructor(
}
fun getContentFromInitSync(roomId: String): ReadReceiptContent? {
@Suppress("UNCHECKED_CAST")
return roomSyncEphemeralTemporaryStore.read(roomId)
?.also { roomSyncEphemeralTemporaryStore.delete(roomId) }
?.events
?.firstOrNull { it.type == EventType.RECEIPT }
?.let {
@Suppress("UNCHECKED_CAST")
it.content as? ReadReceiptContent
}
?.content as? ReadReceiptContent
}
}

View file

@ -35,7 +35,7 @@ internal interface RoomSyncEphemeralTemporaryStore {
}
internal class RoomSyncEphemeralTemporaryStoreFile @Inject constructor(
@SessionFilesDirectory private val fileDirectory: File
@SessionFilesDirectory fileDirectory: File
) : RoomSyncEphemeralTemporaryStore {
private val workingDir = File(fileDirectory, "rr")