Fix avatar loading in multiple places and prefers name instead of

display name for avatar fallback.

This also fixes a bug where users didn't get their avatar loaded in the
room list.

Fix #209
This commit is contained in:
Carl Schwan
2021-01-09 00:37:13 +01:00
parent de23eef519
commit 4be3eac7af
11 changed files with 15 additions and 9 deletions

View File

@@ -95,7 +95,7 @@ ToolBar {
Layout.preferredHeight: Kirigami.Units.gridUnit
source: replyUser ? ("image://mxc/" + replyUser.avatarMediaId) : ""
name: replyUser ? replyUser.displayName : i18n("No name")
name: replyUser ? replyUser.name : i18n("No name")
}
Label {

View File

@@ -51,7 +51,7 @@ RowLayout {
Layout.alignment: Qt.AlignTop
visible: showAuthor && Config.showAvatarInTimeline
name: author.displayName
name: author.name
source: author.avatarMediaId ? ("image://mxc/" + author.avatarMediaId) : ""
color: author.color

View File

@@ -31,7 +31,7 @@ QQC2.AbstractButton {
Layout.alignment: Qt.AlignTop
visible: Config.showAvatarInTimeline
source: replyVisible && reply.author.avatarMediaId ? ("image://mxc/" + reply.author.avatarMediaId) : ""
name: replyVisible ? reply.author.displayName : "H"
name: replyVisible ? reply.author.name : "H"
color: replyVisible ? reply.author.color : Kirigami.Theme.highlightColor
}

View File

@@ -25,7 +25,7 @@ RowLayout {
Layout.preferredWidth: Kirigami.Units.iconSizes.small
Layout.preferredHeight: Kirigami.Units.iconSizes.small
name: author.displayName
name: author.name
source: author.avatarMediaId ? ("image://mxc/" + author.avatarMediaId) : ""
color: author.color