mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Use the room heroes when computing a DM avatar. (#2900)
* Use room heroes for DM avatar content ID. * Use RoomAvatar.heroes for the DM Details stack.
This commit is contained in:
@@ -28,12 +28,24 @@ struct UserProfileProxy: Equatable, Hashable {
|
||||
self.avatarURL = avatarURL
|
||||
}
|
||||
|
||||
init(member: RoomMemberDetails) {
|
||||
userID = member.id
|
||||
displayName = member.isBanned ? nil : member.name
|
||||
avatarURL = member.isBanned ? nil : member.avatarURL
|
||||
}
|
||||
|
||||
init(sdkUserProfile: MatrixRustSDK.UserProfile) {
|
||||
userID = sdkUserProfile.userId
|
||||
displayName = sdkUserProfile.displayName
|
||||
avatarURL = sdkUserProfile.avatarUrl.flatMap(URL.init(string:))
|
||||
}
|
||||
|
||||
init(sdkRoomHero: MatrixRustSDK.RoomHero) {
|
||||
userID = sdkRoomHero.userId
|
||||
displayName = sdkRoomHero.displayName
|
||||
avatarURL = sdkRoomHero.avatarUrl.flatMap(URL.init(string:))
|
||||
}
|
||||
|
||||
/// A user is meant to be "verified" when the GET profile returns back either the display name or the avatar
|
||||
/// If isn't we aren't sure that the related matrix id really exists.
|
||||
var isVerified: Bool {
|
||||
|
||||
Reference in New Issue
Block a user