mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Draft : add some doc on ComposerDraftStores
This commit is contained in:
+4
@@ -22,6 +22,10 @@ import io.element.android.libraries.matrix.api.room.draft.ComposerDraft
|
|||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A draft store that persists drafts in the room state.
|
||||||
|
* It can be used to store drafts that should be persisted across app restarts.
|
||||||
|
*/
|
||||||
class MatrixComposerDraftStore @Inject constructor(
|
class MatrixComposerDraftStore @Inject constructor(
|
||||||
private val client: MatrixClient,
|
private val client: MatrixClient,
|
||||||
) : ComposerDraftStore {
|
) : ComposerDraftStore {
|
||||||
|
|||||||
+5
@@ -20,6 +20,11 @@ import io.element.android.libraries.matrix.api.core.RoomId
|
|||||||
import io.element.android.libraries.matrix.api.room.draft.ComposerDraft
|
import io.element.android.libraries.matrix.api.room.draft.ComposerDraft
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A volatile draft store that keeps drafts in memory only.
|
||||||
|
* It can be used to store drafts that should not be persisted across app restarts.
|
||||||
|
* Currently it's used to store draft message when moving to edit mode.
|
||||||
|
*/
|
||||||
class VolatileComposerDraftStore @Inject constructor() : ComposerDraftStore {
|
class VolatileComposerDraftStore @Inject constructor() : ComposerDraftStore {
|
||||||
private val drafts: MutableMap<RoomId, ComposerDraft> = mutableMapOf()
|
private val drafts: MutableMap<RoomId, ComposerDraft> = mutableMapOf()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user