Update doc

This commit is contained in:
Florian Renaud 2022-08-17 16:52:20 +02:00
parent 128ff0d6ec
commit 5d1124aa95
2 changed files with 11 additions and 2 deletions

View file

@ -55,6 +55,13 @@ import org.matrix.android.sdk.internal.task.Task
import org.matrix.android.sdk.internal.util.time.Clock
import javax.inject.Inject
/**
* Generate a list of local state events from the given [CreateRoomBody].
* The states events are generated according to the given configuration and following the matrix specification.
* This list reflects as much as possible a list of state events related to a real room configured and got from the server.
*
* Ref: https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3createroom
*/
internal interface CreateLocalRoomStateEventsTask : Task<Params, List<Event>> {
data class Params(
val roomCreatorUserId: String,
@ -74,6 +81,8 @@ internal class DefaultCreateLocalRoomStateEventsTask @Inject constructor(
createRoomBody = params.createRoomBody
roomCreatorUserId = params.roomCreatorUserId
// Build the list of the state events following the priorities from the matrix specification
// Changing the order of the events might break the correct display of the room on the client side
return buildList {
createRoomCreateEvent()
createRoomMemberEvents(listOf(roomCreatorUserId))

View file

@ -53,11 +53,11 @@ import java.util.concurrent.TimeUnit
import javax.inject.Inject
/**
* Create a Room from a "fake" local room.
* Create a room on the server from a local room.
* The configuration of the local room will be use to configure the new room.
* The potential local room members will also be invited to this new room.
*
* A "fake" local tombstone event will be created to indicate that the local room has been replacing by the new one.
* A local tombstone event will be created to indicate that the local room has been replacing by the new one.
*/
internal interface CreateRoomFromLocalRoomTask : Task<CreateRoomFromLocalRoomTask.Params, String> {
data class Params(val localRoomId: String)