mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:05:28 +00:00
Move and refactor MatrixUser (#381)
Move and refactor MatrixUser Instead of living in matrixui and having an AvatarData, this can reside in the matrix module and just have the URL. An extension method in matrixui can then provide the AvatarData when required. This removes some small duplication, and pushes the UI-specific information (i.e., what size of avatar is going to be rendered) further down the stack. It also aligns the field names with those used by the rust SDK (e.g. "displayName" instead of "userName").
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ import io.element.android.libraries.matrix.api.pusher.PushersService
|
||||
import io.element.android.libraries.matrix.api.room.MatrixRoom
|
||||
import io.element.android.libraries.matrix.api.room.RoomMembershipObserver
|
||||
import io.element.android.libraries.matrix.api.room.RoomSummaryDataSource
|
||||
import io.element.android.libraries.matrix.api.usersearch.MatrixSearchUserResults
|
||||
import io.element.android.libraries.matrix.api.user.MatrixSearchUserResults
|
||||
import io.element.android.libraries.matrix.api.verification.SessionVerificationService
|
||||
import io.element.android.libraries.matrix.impl.media.RustMediaResolver
|
||||
import io.element.android.libraries.matrix.impl.notification.RustNotificationService
|
||||
|
||||
+4
-4
@@ -17,8 +17,8 @@
|
||||
package io.element.android.libraries.matrix.impl.usersearch
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
import io.element.android.libraries.matrix.api.usersearch.MatrixSearchUserResults
|
||||
import io.element.android.libraries.matrix.api.usersearch.MatrixUserProfile
|
||||
import io.element.android.libraries.matrix.api.user.MatrixSearchUserResults
|
||||
import io.element.android.libraries.matrix.api.user.MatrixUser
|
||||
import org.matrix.rustcomponents.sdk.SearchUsersResults
|
||||
import org.matrix.rustcomponents.sdk.UserProfile
|
||||
|
||||
@@ -31,8 +31,8 @@ object UserSearchResultMapper {
|
||||
)
|
||||
}
|
||||
|
||||
private fun mapUserProfile(userProfile: UserProfile): MatrixUserProfile {
|
||||
return MatrixUserProfile(
|
||||
private fun mapUserProfile(userProfile: UserProfile): MatrixUser {
|
||||
return MatrixUser(
|
||||
userId = UserId(userProfile.userId),
|
||||
displayName = userProfile.displayName,
|
||||
avatarUrl = userProfile.avatarUrl,
|
||||
|
||||
Reference in New Issue
Block a user