Unify getUser
Always use `NeoChatRoom::getUser` for getting user details in a room context. - `MessageEventModel` now calls `getUser` - `getUser` is now overloaded to also be able to take a `NeoChatUser*` - add params to `getUser` that are needed for the model outputs
This commit is contained in:
@@ -15,7 +15,6 @@ QQC2.Control {
|
||||
|
||||
property alias textField: textField
|
||||
property bool isReplying: currentRoom.chatBoxReplyId.length > 0
|
||||
property NeoChatUser replyUser: currentRoom.chatBoxReplyUser
|
||||
property bool attachmentPaneVisible: currentRoom.chatBoxAttachmentPath.length > 0
|
||||
|
||||
signal messageSent()
|
||||
@@ -244,9 +243,9 @@ QQC2.Control {
|
||||
Component {
|
||||
id: replyPane
|
||||
ReplyPane {
|
||||
userName: root.replyUser ? root.replyUser.displayName : ""
|
||||
userColor: root.replyUser ? root.replyUser.color : ""
|
||||
userAvatar: root.replyUser ? "image://mxc/" + currentRoom.getUser(root.replyUser.id).avatarMediaId : ""
|
||||
userName: currentRoom.chatBoxReplyUser.displayName
|
||||
userColor: currentRoom.chatBoxReplyUser.color
|
||||
userAvatar: currentRoom.chatBoxReplyUser.avatarSource
|
||||
text: currentRoom.chatBoxReplyMessage
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ Components.AlbumMaximizeComponent {
|
||||
implicitWidth: Kirigami.Units.iconSizes.medium
|
||||
implicitHeight: Kirigami.Units.iconSizes.medium
|
||||
|
||||
name: root.author.name ?? root.author.displayName
|
||||
name: root.author.displayName
|
||||
source: root.author.avatarSource
|
||||
color: root.author.color
|
||||
}
|
||||
@@ -62,7 +62,7 @@ Components.AlbumMaximizeComponent {
|
||||
spacing: 0
|
||||
QQC2.Label {
|
||||
id: userLabel
|
||||
text: root.author.name ?? root.author.displayName
|
||||
text: root.author.displayName
|
||||
color: root.author.color
|
||||
font.weight: Font.Bold
|
||||
elide: Text.ElideRight
|
||||
|
||||
@@ -93,7 +93,7 @@ TimelineContainer {
|
||||
visible: root.asset === "m.self"
|
||||
width: height
|
||||
height: parent.height / 3 + 1
|
||||
name: root.author.name ?? root.author.displayName
|
||||
name: root.author.displayName
|
||||
source: root.author.avatarSource
|
||||
color: root.author.color
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ Item {
|
||||
implicitHeight: Kirigami.Units.iconSizes.small
|
||||
|
||||
source: root.author.avatarSource
|
||||
name: root.author.displayName || ""
|
||||
name: root.author.displayName
|
||||
color: root.author.color
|
||||
}
|
||||
QQC2.Label {
|
||||
|
||||
@@ -381,7 +381,7 @@ ColumnLayout {
|
||||
visible: root.showAuthor &&
|
||||
Config.showAvatarInTimeline &&
|
||||
(Config.compactLayout || !showUserMessageOnRight)
|
||||
name: root.author.name ?? root.author.displayName
|
||||
name: root.author.displayName
|
||||
source: root.author.avatarSource
|
||||
color: root.author.color
|
||||
|
||||
|
||||
Reference in New Issue
Block a user