forked from mirror/nheko
This currently assumes the event, that is replied to, is already fetched. If it isn't, it will render an empty reply. In the future we should fetch replies before rendering them.remotes/origin/0.7.0-dev
parent
b130b85df8
commit
2b3dc3d8b9
@ -1,67 +1,81 @@ |
||||
import QtQuick 2.6 |
||||
import im.nheko 1.0 |
||||
|
||||
DelegateChooser { |
||||
//role: "type" //< not supported in our custom implementation, have to use roleValue |
||||
roleValue: model.type |
||||
|
||||
DelegateChoice { |
||||
roleValue: MtxEvent.TextMessage |
||||
TextMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.NoticeMessage |
||||
NoticeMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.EmoteMessage |
||||
TextMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.ImageMessage |
||||
ImageMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.Sticker |
||||
ImageMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.FileMessage |
||||
FileMessage {} |
||||
Item { |
||||
// Workaround to have an assignable global property |
||||
Item { |
||||
id: model |
||||
property var data; |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.VideoMessage |
||||
PlayableMediaMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.AudioMessage |
||||
PlayableMediaMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.Redacted |
||||
Pill { |
||||
text: qsTr("redacted") |
||||
|
||||
property alias modelData: model.data |
||||
|
||||
height: chooser.childrenRect.height |
||||
|
||||
DelegateChooser { |
||||
id: chooser |
||||
//role: "type" //< not supported in our custom implementation, have to use roleValue |
||||
roleValue: model.data.type |
||||
anchors.fill: parent |
||||
|
||||
DelegateChoice { |
||||
roleValue: MtxEvent.TextMessage |
||||
TextMessage {} |
||||
} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.Encryption |
||||
Pill { |
||||
text: qsTr("Encryption enabled") |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.NoticeMessage |
||||
NoticeMessage {} |
||||
} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.Name |
||||
NoticeMessage { |
||||
notice: model.roomName ? qsTr("room name changed to: %1").arg(model.roomName) : qsTr("removed room name") |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.EmoteMessage |
||||
TextMessage {} |
||||
} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.Topic |
||||
NoticeMessage { |
||||
notice: model.roomTopic ? qsTr("topic changed to: %1").arg(model.roomTopic) : qsTr("removed topic") |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.ImageMessage |
||||
ImageMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.Sticker |
||||
ImageMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.FileMessage |
||||
FileMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.VideoMessage |
||||
PlayableMediaMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.AudioMessage |
||||
PlayableMediaMessage {} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.Redacted |
||||
Pill { |
||||
text: qsTr("redacted") |
||||
} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.Encryption |
||||
Pill { |
||||
text: qsTr("Encryption enabled") |
||||
} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.Name |
||||
NoticeMessage { |
||||
notice: model.data.roomName ? qsTr("room name changed to: %1").arg(model.data.roomName) : qsTr("removed room name") |
||||
} |
||||
} |
||||
DelegateChoice { |
||||
roleValue: MtxEvent.Topic |
||||
NoticeMessage { |
||||
notice: model.data.roomTopic ? qsTr("topic changed to: %1").arg(model.data.roomTopic) : qsTr("removed topic") |
||||
} |
||||
} |
||||
DelegateChoice { |
||||
Placeholder {} |
||||
} |
||||
} |
||||
DelegateChoice { |
||||
Placeholder {} |
||||
} |
||||
} |
||||
|
@ -1,7 +1,7 @@ |
||||
import ".." |
||||
|
||||
MatrixText { |
||||
text: qsTr("unimplemented event: ") + model.type |
||||
text: qsTr("unimplemented event: ") + model.data.type |
||||
width: parent ? parent.width : undefined |
||||
color: inactiveColors.text |
||||
} |
||||
|
@ -1,6 +1,6 @@ |
||||
import ".." |
||||
|
||||
MatrixText { |
||||
text: model.formattedBody.replace("<pre>", "<pre style='white-space: pre-wrap'>") |
||||
text: model.data.formattedBody.replace("<pre>", "<pre style='white-space: pre-wrap'>") |
||||
width: parent ? parent.width : undefined |
||||
} |
||||
|
Loading…
Reference in new issue