2019-10-20 13:39:47 +03:00
|
|
|
import QtQuick 2.6
|
2019-11-30 03:43:39 +03:00
|
|
|
import im.nheko 1.0
|
2019-10-20 13:39:47 +03:00
|
|
|
|
2020-01-11 16:07:51 +03:00
|
|
|
Item {
|
|
|
|
// Workaround to have an assignable global property
|
|
|
|
Item {
|
|
|
|
id: model
|
|
|
|
property var data;
|
2019-10-20 13:39:47 +03:00
|
|
|
}
|
2020-01-11 16:07:51 +03:00
|
|
|
|
|
|
|
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 {}
|
2019-11-22 19:08:32 +03:00
|
|
|
}
|
2020-01-11 16:07:51 +03:00
|
|
|
DelegateChoice {
|
|
|
|
roleValue: MtxEvent.NoticeMessage
|
|
|
|
NoticeMessage {}
|
2019-11-22 19:08:32 +03:00
|
|
|
}
|
2020-01-11 16:07:51 +03:00
|
|
|
DelegateChoice {
|
|
|
|
roleValue: MtxEvent.EmoteMessage
|
|
|
|
TextMessage {}
|
2019-12-10 16:46:52 +03:00
|
|
|
}
|
2020-01-11 16:07:51 +03:00
|
|
|
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 {}
|
2019-12-10 16:46:52 +03:00
|
|
|
}
|
2019-10-20 13:39:47 +03:00
|
|
|
}
|
|
|
|
}
|