From 5d1124aa9545e450444ad21d995d814473d2062c Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Wed, 17 Aug 2022 16:52:20 +0200 Subject: [PATCH] Update doc --- .../room/create/CreateLocalRoomStateEventsTask.kt | 9 +++++++++ .../session/room/create/CreateRoomFromLocalRoomTask.kt | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateLocalRoomStateEventsTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateLocalRoomStateEventsTask.kt index 21b8e3a5d8..47af08292e 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateLocalRoomStateEventsTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateLocalRoomStateEventsTask.kt @@ -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> { 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)) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateRoomFromLocalRoomTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateRoomFromLocalRoomTask.kt index f861977dd1..02538a5cc3 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateRoomFromLocalRoomTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateRoomFromLocalRoomTask.kt @@ -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 { data class Params(val localRoomId: String)