-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3501 from element-hq/bma/testRustMatrixClient
Test RustMatrixClient and other classes in the matrix module
- Loading branch information
Showing
70 changed files
with
1,598 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/ClientBuilderProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright 2024 New Vector Ltd. | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* Please see LICENSE in the repository root for full details. | ||
*/ | ||
|
||
package io.element.android.libraries.matrix.impl | ||
|
||
import com.squareup.anvil.annotations.ContributesBinding | ||
import io.element.android.libraries.di.AppScope | ||
import org.matrix.rustcomponents.sdk.ClientBuilder | ||
import javax.inject.Inject | ||
|
||
interface ClientBuilderProvider { | ||
fun provide(): ClientBuilder | ||
} | ||
|
||
@ContributesBinding(AppScope::class) | ||
class RustClientBuilderProvider @Inject constructor() : ClientBuilderProvider { | ||
override fun provide(): ClientBuilder { | ||
return ClientBuilder() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...in/kotlin/io/element/android/libraries/matrix/impl/room/TimelineEventTypeFilterFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2024 New Vector Ltd. | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* Please see LICENSE in the repository root for full details. | ||
*/ | ||
|
||
package io.element.android.libraries.matrix.impl.room | ||
|
||
import com.squareup.anvil.annotations.ContributesBinding | ||
import io.element.android.libraries.di.AppScope | ||
import io.element.android.libraries.matrix.api.room.StateEventType | ||
import org.matrix.rustcomponents.sdk.FilterTimelineEventType | ||
import org.matrix.rustcomponents.sdk.TimelineEventTypeFilter | ||
import javax.inject.Inject | ||
|
||
interface TimelineEventTypeFilterFactory { | ||
fun create(listStateEventType: List<StateEventType>): TimelineEventTypeFilter | ||
} | ||
|
||
@ContributesBinding(AppScope::class) | ||
class RustTimelineEventTypeFilterFactory @Inject constructor() : TimelineEventTypeFilterFactory { | ||
override fun create(listStateEventType: List<StateEventType>): TimelineEventTypeFilter { | ||
return TimelineEventTypeFilter.exclude( | ||
listStateEventType.map { stateEventType -> | ||
FilterTimelineEventType.State(stateEventType.map()) | ||
} | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.