mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Merge branch 'develop' into feature/fga/pinned_message_banner_logic
This commit is contained in:
+8
-1
@@ -32,7 +32,14 @@ sealed interface OtherState {
|
||||
data object RoomHistoryVisibility : OtherState
|
||||
data object RoomJoinRules : OtherState
|
||||
data class RoomName(val name: String?) : OtherState
|
||||
data object RoomPinnedEvents : OtherState
|
||||
data class RoomPinnedEvents(val change: Change) : OtherState {
|
||||
enum class Change {
|
||||
ADDED,
|
||||
REMOVED,
|
||||
CHANGED
|
||||
}
|
||||
}
|
||||
|
||||
data class RoomUserPowerLevels(val users: Map<String, Long>) : OtherState
|
||||
data object RoomServerAcl : OtherState
|
||||
data class RoomThirdPartyInvite(val displayName: String?) : OtherState
|
||||
|
||||
+10
-1
@@ -40,6 +40,7 @@ import kotlinx.collections.immutable.toImmutableMap
|
||||
import org.matrix.rustcomponents.sdk.TimelineItemContent
|
||||
import org.matrix.rustcomponents.sdk.TimelineItemContentKind
|
||||
import org.matrix.rustcomponents.sdk.use
|
||||
import uniffi.matrix_sdk_ui.RoomPinnedEventsChange
|
||||
import org.matrix.rustcomponents.sdk.EncryptedMessage as RustEncryptedMessage
|
||||
import org.matrix.rustcomponents.sdk.MembershipChange as RustMembershipChange
|
||||
import org.matrix.rustcomponents.sdk.OtherState as RustOtherState
|
||||
@@ -176,7 +177,7 @@ private fun RustOtherState.map(): OtherState {
|
||||
RustOtherState.RoomHistoryVisibility -> OtherState.RoomHistoryVisibility
|
||||
RustOtherState.RoomJoinRules -> OtherState.RoomJoinRules
|
||||
is RustOtherState.RoomName -> OtherState.RoomName(name)
|
||||
is RustOtherState.RoomPinnedEvents -> OtherState.RoomPinnedEvents
|
||||
is RustOtherState.RoomPinnedEvents -> OtherState.RoomPinnedEvents(change.map())
|
||||
is RustOtherState.RoomPowerLevels -> OtherState.RoomUserPowerLevels(users)
|
||||
RustOtherState.RoomServerAcl -> OtherState.RoomServerAcl
|
||||
is RustOtherState.RoomThirdPartyInvite -> OtherState.RoomThirdPartyInvite(displayName)
|
||||
@@ -187,6 +188,14 @@ private fun RustOtherState.map(): OtherState {
|
||||
}
|
||||
}
|
||||
|
||||
private fun RoomPinnedEventsChange.map(): OtherState.RoomPinnedEvents.Change {
|
||||
return when (this) {
|
||||
RoomPinnedEventsChange.ADDED -> OtherState.RoomPinnedEvents.Change.ADDED
|
||||
RoomPinnedEventsChange.REMOVED -> OtherState.RoomPinnedEvents.Change.REMOVED
|
||||
RoomPinnedEventsChange.CHANGED -> OtherState.RoomPinnedEvents.Change.CHANGED
|
||||
}
|
||||
}
|
||||
|
||||
private fun RustEncryptedMessage.map(): UnableToDecryptContent.Data {
|
||||
return when (this) {
|
||||
is RustEncryptedMessage.MegolmV1AesSha2 -> UnableToDecryptContent.Data.MegolmV1AesSha2(sessionId, cause.map())
|
||||
|
||||
Reference in New Issue
Block a user