dependencies (rust sdk) : replace RoomTombstone by SuccessorRoom

This commit is contained in:
ganfra 2025-06-02 20:33:34 +02:00
parent b8afce8664
commit be2d83b4da
7 changed files with 53 additions and 24 deletions

View file

@ -32,7 +32,6 @@ data class RoomInfo(
val isEncrypted: Boolean?,
val joinRule: JoinRule?,
val isSpace: Boolean,
val tombstone: RoomTombstone?,
val isFavorite: Boolean,
val canonicalAlias: RoomAlias?,
val alternativeAliases: ImmutableList<RoomAlias>,
@ -74,12 +73,8 @@ data class RoomInfo(
val pinnedEventIds: ImmutableList<EventId>,
val creator: UserId?,
val historyVisibility: RoomHistoryVisibility,
val successorRoom: SuccessorRoom?,
) {
val aliases: List<RoomAlias>
get() = listOfNotNull(canonicalAlias) + alternativeAliases
}
data class RoomTombstone(
val body: String,
val replacementRoomId: RoomId,
)

View file

@ -0,0 +1,30 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.matrix.api.room
import io.element.android.libraries.matrix.api.core.RoomId
/**
*
* When a room A is tombstoned, it is replaced by a room B. The room A is the
* predecessor of B, and B is the successor of A. This type holds information
* about the successor room.
*
* A room is tombstoned if it has received a m.room.tombstone state event.
*
*/
data class SuccessorRoom(
/**
* The ID of the replacement room.
*/
val roomId: RoomId,
/**
* The message explaining why the room has been tombstoned.
*/
val reason: String?,
)