Improve User Avatar Model Roles
- Update the message event and user models so that the full source url is output. - Separate the reply author into its own role - Create an empty user object that can be passed so that the QML code no longer needs to check if certain parameters exist. - Make avatarForMember return and empty QUrl if a valid avatar cannot be found and make use in the user and event models As well as cleaning up the QML this should also stop the QML Image: Media id '' doesn't follow server/mediaId pattern spam in the log.
This commit is contained in:
@@ -19,7 +19,7 @@ Kirigami.OverlaySheet {
|
||||
property var user
|
||||
|
||||
property string displayName: user.displayName
|
||||
readonly property string avatar: room.avatarForMember(user)
|
||||
readonly property url avatar: room.avatarForMember(user)
|
||||
|
||||
parent: applicationWindow().overlay
|
||||
|
||||
@@ -45,7 +45,7 @@ Kirigami.OverlaySheet {
|
||||
Layout.preferredHeight: Kirigami.Units.iconSizes.huge
|
||||
|
||||
name: displayName
|
||||
source: avatar ?? ""
|
||||
source: avatar
|
||||
color: user.color
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user