2022-09-15 16:34:41 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
|
|
|
import shared 1.0
|
|
|
|
import utils 1.0
|
2022-09-23 14:14:31 +00:00
|
|
|
|
|
|
|
import "../controls"
|
2022-09-15 16:34:41 +00:00
|
|
|
|
2022-09-16 13:06:52 +00:00
|
|
|
ActivityNotificationMessage {
|
2022-09-15 16:34:41 +00:00
|
|
|
id: root
|
|
|
|
|
2023-03-02 12:55:49 +00:00
|
|
|
function badgeTextFromRepliedMessageContent(message) {
|
|
|
|
switch (message.contentType) {
|
|
|
|
case Constants.messageContentType.stickerType:
|
|
|
|
return qsTr("sticker")
|
|
|
|
case Constants.messageContentType.emojiType:
|
|
|
|
return qsTr("emoji")
|
|
|
|
case Constants.messageContentType.transactionType:
|
|
|
|
return qsTr("transaction")
|
|
|
|
case Constants.messageContentType.imageType:
|
|
|
|
return qsTr("image")
|
|
|
|
case Constants.messageContentType.audioType:
|
|
|
|
return qsTr("audio")
|
|
|
|
default:
|
|
|
|
return message.messageText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-23 14:14:31 +00:00
|
|
|
badgeComponent: ReplyBadge {
|
2023-03-02 12:55:49 +00:00
|
|
|
repliedMessageContent: notification ? badgeTextFromRepliedMessageContent(notification.repliedMessage) : ""
|
2022-10-29 07:17:35 +00:00
|
|
|
onReplyClicked: {
|
|
|
|
root.activityCenterStore.switchTo(notification)
|
2022-11-16 17:17:38 +00:00
|
|
|
root.closeActivityCenter()
|
2023-06-15 14:33:49 +00:00
|
|
|
root.store.messageStore.messageModule.jumpToMessage(model.id)
|
2022-10-29 07:17:35 +00:00
|
|
|
}
|
2022-09-23 14:14:31 +00:00
|
|
|
}
|
2022-11-22 22:01:30 +00:00
|
|
|
|
|
|
|
onMessageClicked: {
|
|
|
|
root.activityCenterStore.switchTo(notification)
|
|
|
|
root.closeActivityCenter()
|
|
|
|
}
|
|
|
|
}
|