feat(ActivityCenter): Override replied text for messages with rich content
Close #9416
This commit is contained in:
parent
71bbb03faa
commit
ec51fbe0e0
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue