From ec51fbe0e040d7986e085c008c13d92bb8a94688 Mon Sep 17 00:00:00 2001 From: MishkaRogachev Date: Thu, 2 Mar 2023 16:55:49 +0400 Subject: [PATCH] feat(ActivityCenter): Override replied text for messages with rich content Close #9416 --- .../views/ActivityNotificationReply.qml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ui/app/mainui/activitycenter/views/ActivityNotificationReply.qml b/ui/app/mainui/activitycenter/views/ActivityNotificationReply.qml index 179dab3d4b..69fd282e51 100644 --- a/ui/app/mainui/activitycenter/views/ActivityNotificationReply.qml +++ b/ui/app/mainui/activitycenter/views/ActivityNotificationReply.qml @@ -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()