mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Merge branch 'develop' into feature/valere/timeline_active_call_rendering
This commit is contained in:
+1
-4
@@ -90,7 +90,6 @@ sealed interface NotificationContent {
|
||||
val question: String,
|
||||
) : MessageLike
|
||||
|
||||
// TODO put real implementation
|
||||
data object Beacon : MessageLike
|
||||
}
|
||||
|
||||
@@ -119,9 +118,7 @@ sealed interface NotificationContent {
|
||||
data class RoomTopic(val topic: String) : StateEvent
|
||||
data object SpaceChild : StateEvent
|
||||
data object SpaceParent : StateEvent
|
||||
|
||||
// TODO put real implementation
|
||||
data object Beacon : StateEvent
|
||||
data object BeaconInfo : StateEvent
|
||||
}
|
||||
|
||||
data class Invite(
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ private fun StateEventContent.toContent(): NotificationContent.StateEvent {
|
||||
is StateEventContent.RoomTopic -> NotificationContent.StateEvent.RoomTopic(topic)
|
||||
StateEventContent.SpaceChild -> NotificationContent.StateEvent.SpaceChild
|
||||
StateEventContent.SpaceParent -> NotificationContent.StateEvent.SpaceParent
|
||||
StateEventContent.BeaconInfo -> NotificationContent.StateEvent.Beacon
|
||||
StateEventContent.BeaconInfo -> NotificationContent.StateEvent.BeaconInfo
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -90,6 +90,8 @@ class RustMatrixClientTest {
|
||||
userId = userId,
|
||||
displayName = A_USER_NAME,
|
||||
avatarUrl = AN_AVATAR_URL,
|
||||
status = null,
|
||||
call = null,
|
||||
)
|
||||
},
|
||||
),
|
||||
|
||||
+6
@@ -9,14 +9,20 @@
|
||||
package io.element.android.libraries.matrix.impl.fixtures.factories
|
||||
|
||||
import io.element.android.libraries.matrix.test.A_USER_ID
|
||||
import org.matrix.rustcomponents.sdk.UserCall
|
||||
import org.matrix.rustcomponents.sdk.UserProfile
|
||||
import org.matrix.rustcomponents.sdk.UserStatus
|
||||
|
||||
internal fun aRustUserProfile(
|
||||
userId: String = A_USER_ID.value,
|
||||
displayName: String = "displayName",
|
||||
avatarUrl: String = "avatarUrl",
|
||||
status: UserStatus? = null,
|
||||
call: UserCall? = null,
|
||||
) = UserProfile(
|
||||
userId = userId,
|
||||
displayName = displayName,
|
||||
avatarUrl = avatarUrl,
|
||||
status = status,
|
||||
call = call,
|
||||
)
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@
|
||||
package io.element.android.libraries.matrix.impl.fixtures.fakes
|
||||
|
||||
import io.element.android.libraries.matrix.impl.fixtures.factories.aRustSession
|
||||
import io.element.android.libraries.matrix.impl.fixtures.factories.aRustUserProfile
|
||||
import io.element.android.libraries.matrix.test.A_DEVICE_ID
|
||||
import io.element.android.libraries.matrix.test.A_HOMESERVER_URL
|
||||
import io.element.android.libraries.matrix.test.A_USER_ID
|
||||
@@ -49,7 +50,7 @@ class FakeFfiClient(
|
||||
private val session: Session = aRustSession(),
|
||||
private val clearCachesResult: () -> Unit = { lambdaError() },
|
||||
private val withUtdHook: (UnableToDecryptDelegate) -> Unit = { lambdaError() },
|
||||
private val getProfileResult: (String) -> UserProfile = { UserProfile(userId = userId, displayName = null, avatarUrl = null) },
|
||||
private val getProfileResult: (String) -> UserProfile = { aRustUserProfile() },
|
||||
private val homeserverLoginDetailsResult: () -> HomeserverLoginDetails = { lambdaError() },
|
||||
private val getStoreSizesResult: () -> StoreSizes = { lambdaError() },
|
||||
private val createRoomResult: (CreateRoomParameters) -> String = { lambdaError() },
|
||||
|
||||
+4
-4
@@ -126,7 +126,7 @@ class FakeMatrixClient(
|
||||
private val getMapStyleUrlResult: () -> Result<String?> = { lambdaError() },
|
||||
private val getDatabaseSizesLambda: () -> Result<SdkStoreSizes> = { lambdaError() },
|
||||
private val resetWellKnownConfigLambda: () -> Result<Unit> = { lambdaError() },
|
||||
override val contentScanner: ContentScanner? = null
|
||||
override val contentScanner: ContentScanner? = null,
|
||||
) : MatrixClient {
|
||||
var setDisplayNameCalled: Boolean = false
|
||||
private set
|
||||
@@ -144,7 +144,7 @@ class FakeMatrixClient(
|
||||
private val _userProfile: MutableStateFlow<MatrixUser> = MutableStateFlow(MatrixUser(sessionId, userDisplayName, userAvatarUrl))
|
||||
override val userProfile: StateFlow<MatrixUser> = _userProfile
|
||||
|
||||
private var createRoomResult: Result<RoomId> = Result.success(A_ROOM_ID)
|
||||
var createRoomResult: (CreateRoomParameters) -> Result<RoomId> = { Result.success(A_ROOM_ID) }
|
||||
private var createDmResult: Result<RoomId> = Result.success(A_ROOM_ID)
|
||||
private var findDmResult: Result<RoomId?> = Result.success(A_ROOM_ID)
|
||||
private val getRoomResults = mutableMapOf<RoomId, BaseRoom>()
|
||||
@@ -193,7 +193,7 @@ class FakeMatrixClient(
|
||||
}
|
||||
|
||||
override suspend fun createRoom(createRoomParams: CreateRoomParameters): Result<RoomId> = simulateLongTask {
|
||||
return createRoomResult
|
||||
return createRoomResult(createRoomParams)
|
||||
}
|
||||
|
||||
override suspend fun createDM(userId: UserId): Result<RoomId> = simulateLongTask {
|
||||
@@ -297,7 +297,7 @@ class FakeMatrixClient(
|
||||
// Mocks
|
||||
|
||||
fun givenCreateRoomResult(result: Result<RoomId>) {
|
||||
createRoomResult = result
|
||||
createRoomResult = { result }
|
||||
}
|
||||
|
||||
fun givenCreateDmResult(result: Result<RoomId>) {
|
||||
|
||||
Reference in New Issue
Block a user