Update dependency org.matrix.rustcomponents:sdk-android to v25.7.23 (#5073)

* Update dependency org.matrix.rustcomponents:sdk-android to v25.7.23

* Adapt to SDK changes:

- Add 'creator' role, adapt existing logic to it.
- Remove `ReplyParameters`, replace with `EventId` where possible.
- Fix changes in OIDC auth methods.
- Add more join rules.

* Make sure both creators and users with power level >= 150 are displayed as 'owners' in the room member list.

* Don't close the roles and permissions screen if the user is a creator

* Use `MediaPreviewValue.DEFAULT` for `MediaPreviewConfig.DEFAULT` too

* Improve APIs around checking roles and power levels:
    - Ensure `RoomInfo.RoomPowerLevels.users` can't be directly used to check power levels since it can't check the power levels for creators.
    - Add a few helper functions to handle actions that relied on the previous `users` property, and docs to explain their usages.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
This commit is contained in:
renovate[bot] 2025-07-24 11:58:30 +02:00 committed by GitHub
parent 33aa7a914f
commit 040fde7f22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 264 additions and 227 deletions

View file

@ -84,7 +84,7 @@ class FakeMatrixClient(
private val getNotJoinedRoomResult: (RoomIdOrAlias, List<String>) -> Result<NotJoinedRoom> = { _, _ -> lambdaError() },
private val clearCacheLambda: () -> Unit = { lambdaError() },
private val userIdServerNameLambda: () -> String = { lambdaError() },
private val getUrlLambda: (String) -> Result<String> = { lambdaError() },
private val getUrlLambda: (String) -> Result<ByteArray> = { lambdaError() },
private val canDeactivateAccountResult: () -> Boolean = { lambdaError() },
private val deactivateAccountResult: (String, Boolean) -> Result<Unit> = { _, _ -> lambdaError() },
private val currentSlidingSyncVersionLambda: () -> Result<SlidingSyncVersion> = { lambdaError() },
@ -324,7 +324,7 @@ class FakeMatrixClient(
return userIdServerNameLambda()
}
override suspend fun getUrl(url: String): Result<String> {
override suspend fun getUrl(url: String): Result<ByteArray> {
return getUrlLambda(url)
}

View file

@ -59,7 +59,7 @@ fun aRoomInfo(
activeRoomCallParticipants: List<UserId> = emptyList(),
heroes: List<MatrixUser> = emptyList(),
pinnedEventIds: List<EventId> = emptyList(),
roomCreator: UserId? = null,
roomCreators: List<UserId> = emptyList(),
isMarkedUnread: Boolean = false,
numUnreadMessages: Long = 0,
numUnreadNotifications: Long = 0,
@ -93,7 +93,7 @@ fun aRoomInfo(
activeRoomCallParticipants = activeRoomCallParticipants.toImmutableList(),
heroes = heroes.toImmutableList(),
pinnedEventIds = pinnedEventIds.toImmutableList(),
creator = roomCreator,
creators = roomCreators.toImmutableList(),
isMarkedUnread = isMarkedUnread,
numUnreadMessages = numUnreadMessages,
numUnreadNotifications = numUnreadNotifications,

View file

@ -31,6 +31,7 @@ import io.element.android.libraries.matrix.test.A_ROOM_TOPIC
import io.element.android.libraries.matrix.test.A_USER_ID
import io.element.android.libraries.matrix.test.timeline.anEventTimelineItem
import kotlinx.collections.immutable.persistentMapOf
import kotlinx.collections.immutable.toImmutableList
import kotlinx.collections.immutable.toPersistentList
fun aRoomSummary(
@ -72,7 +73,7 @@ fun aRoomSummary(
activeRoomCallParticipants: List<UserId> = emptyList(),
heroes: List<MatrixUser> = emptyList(),
pinnedEventIds: List<EventId> = emptyList(),
roomCreator: UserId? = null,
roomCreators: List<UserId> = emptyList(),
isMarkedUnread: Boolean = false,
numUnreadMessages: Long = 0,
numUnreadNotifications: Long = 0,
@ -94,7 +95,7 @@ fun aRoomSummary(
successorRoom = successorRoom,
isFavorite = isFavorite,
canonicalAlias = canonicalAlias,
alternativeAliases = alternativeAliases.toPersistentList(),
alternativeAliases = alternativeAliases.toImmutableList(),
currentUserMembership = currentUserMembership,
inviter = inviter,
activeMembersCount = activeMembersCount,
@ -105,10 +106,10 @@ fun aRoomSummary(
notificationCount = notificationCount,
userDefinedNotificationMode = userDefinedNotificationMode,
hasRoomCall = hasRoomCall,
activeRoomCallParticipants = activeRoomCallParticipants.toPersistentList(),
activeRoomCallParticipants = activeRoomCallParticipants.toImmutableList(),
heroes = heroes.toPersistentList(),
pinnedEventIds = pinnedEventIds.toPersistentList(),
creator = roomCreator,
pinnedEventIds = pinnedEventIds.toImmutableList(),
creators = roomCreators.toImmutableList(),
isMarkedUnread = isMarkedUnread,
numUnreadMessages = numUnreadMessages,
numUnreadNotifications = numUnreadNotifications,

View file

@ -19,7 +19,6 @@ import io.element.android.libraries.matrix.api.media.VideoInfo
import io.element.android.libraries.matrix.api.poll.PollKind
import io.element.android.libraries.matrix.api.room.IntentionalMention
import io.element.android.libraries.matrix.api.room.location.AssetType
import io.element.android.libraries.matrix.api.room.message.ReplyParameters
import io.element.android.libraries.matrix.api.timeline.MatrixTimelineItem
import io.element.android.libraries.matrix.api.timeline.ReceiptType
import io.element.android.libraries.matrix.api.timeline.Timeline
@ -122,7 +121,7 @@ class FakeTimeline(
)
var replyMessageLambda: (
replyParameters: ReplyParameters,
inReplyToEventId: EventId?,
body: String,
htmlBody: String?,
intentionalMentions: List<IntentionalMention>,
@ -132,13 +131,13 @@ class FakeTimeline(
}
override suspend fun replyMessage(
replyParameters: ReplyParameters,
repliedToEventId: EventId,
body: String,
htmlBody: String?,
intentionalMentions: List<IntentionalMention>,
fromNotification: Boolean,
): Result<Unit> = replyMessageLambda(
replyParameters,
repliedToEventId,
body,
htmlBody,
intentionalMentions,
@ -152,7 +151,7 @@ class FakeTimeline(
body: String?,
formattedBody: String?,
progressCallback: ProgressCallback?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
) -> Result<MediaUploadHandler> = { _, _, _, _, _, _, _ ->
Result.success(FakeMediaUploadHandler())
}
@ -164,7 +163,7 @@ class FakeTimeline(
caption: String?,
formattedCaption: String?,
progressCallback: ProgressCallback?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
): Result<MediaUploadHandler> = simulateLongTask {
simulateSendMediaProgress(progressCallback)
sendImageLambda(
@ -174,7 +173,7 @@ class FakeTimeline(
caption,
formattedCaption,
progressCallback,
replyParameters,
inReplyToEventId,
)
}
@ -185,7 +184,7 @@ class FakeTimeline(
body: String?,
formattedBody: String?,
progressCallback: ProgressCallback?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
) -> Result<MediaUploadHandler> = { _, _, _, _, _, _, _ ->
Result.success(FakeMediaUploadHandler())
}
@ -197,7 +196,7 @@ class FakeTimeline(
caption: String?,
formattedCaption: String?,
progressCallback: ProgressCallback?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
): Result<MediaUploadHandler> = simulateLongTask {
simulateSendMediaProgress(progressCallback)
sendVideoLambda(
@ -207,7 +206,7 @@ class FakeTimeline(
caption,
formattedCaption,
progressCallback,
replyParameters,
inReplyToEventId,
)
}
@ -217,7 +216,7 @@ class FakeTimeline(
caption: String?,
formattedCaption: String?,
progressCallback: ProgressCallback?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
) -> Result<MediaUploadHandler> = { _, _, _, _, _, _ ->
Result.success(FakeMediaUploadHandler())
}
@ -228,7 +227,7 @@ class FakeTimeline(
caption: String?,
formattedCaption: String?,
progressCallback: ProgressCallback?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
): Result<MediaUploadHandler> = simulateLongTask {
simulateSendMediaProgress(progressCallback)
sendAudioLambda(
@ -237,7 +236,7 @@ class FakeTimeline(
caption,
formattedCaption,
progressCallback,
replyParameters,
inReplyToEventId,
)
}
@ -247,7 +246,7 @@ class FakeTimeline(
caption: String?,
formattedCaption: String?,
progressCallback: ProgressCallback?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
) -> Result<MediaUploadHandler> = { _, _, _, _, _, _ ->
Result.success(FakeMediaUploadHandler())
}
@ -258,7 +257,7 @@ class FakeTimeline(
caption: String?,
formattedCaption: String?,
progressCallback: ProgressCallback?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
): Result<MediaUploadHandler> = simulateLongTask {
simulateSendMediaProgress(progressCallback)
sendFileLambda(
@ -267,7 +266,7 @@ class FakeTimeline(
caption,
formattedCaption,
progressCallback,
replyParameters,
inReplyToEventId,
)
}
@ -276,7 +275,7 @@ class FakeTimeline(
audioInfo: AudioInfo,
waveform: List<Float>,
progressCallback: ProgressCallback?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
) -> Result<MediaUploadHandler> = { _, _, _, _, _ ->
Result.success(FakeMediaUploadHandler())
}
@ -286,7 +285,7 @@ class FakeTimeline(
audioInfo: AudioInfo,
waveform: List<Float>,
progressCallback: ProgressCallback?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
): Result<MediaUploadHandler> = simulateLongTask {
simulateSendMediaProgress(progressCallback)
sendVoiceMessageLambda(
@ -294,7 +293,7 @@ class FakeTimeline(
audioInfo,
waveform,
progressCallback,
replyParameters,
inReplyToEventId,
)
}
@ -304,7 +303,7 @@ class FakeTimeline(
description: String?,
zoomLevel: Int?,
assetType: AssetType?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
) -> Result<Unit> = { _, _, _, _, _, _ ->
lambdaError()
}
@ -315,7 +314,7 @@ class FakeTimeline(
description: String?,
zoomLevel: Int?,
assetType: AssetType?,
replyParameters: ReplyParameters?,
inReplyToEventId: EventId??,
): Result<Unit> = simulateLongTask {
sendLocationLambda(
body,
@ -323,7 +322,7 @@ class FakeTimeline(
description,
zoomLevel,
assetType,
replyParameters,
inReplyToEventId,
)
}