feat(ActivityCenter): Override replied text for messages with rich content

Close #9416
This commit is contained in:
MishkaRogachev 2023-03-02 16:55:49 +04:00 committed by Mikhail Rogachev
parent 71bbb03faa
commit ec51fbe0e0
1 changed files with 18 additions and 1 deletions

View File

@ -13,8 +13,25 @@ import "../controls"
ActivityNotificationMessage {
id: root
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
}
}
badgeComponent: ReplyBadge {
repliedMessageContent: notification ? notification.repliedMessage.messageText : ""
repliedMessageContent: notification ? badgeTextFromRepliedMessageContent(notification.repliedMessage) : ""
onReplyClicked: {
root.activityCenterStore.switchTo(notification)
root.closeActivityCenter()