mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-19 17:58:48 +00:00
Add message preview for polls
This commit is contained in:
@@ -3068,6 +3068,10 @@
|
||||
"messageformat": "Sticker message",
|
||||
"description": "Shown in notifications and in the left pane instead of sticker image."
|
||||
},
|
||||
"icu:message--getNotificationText--poll": {
|
||||
"messageformat": "Poll: {pollQuestion}",
|
||||
"description": "Shown in notifications and in the left pane when a poll message is received. {pollQuestion} is the poll question text."
|
||||
},
|
||||
"icu:message--getNotificationText--text-with-emoji": {
|
||||
"messageformat": "{emoji} {text}",
|
||||
"description": "Shown in notifications and in the left pane when text has an emoji. Probably always [emoji] [text] on LTR languages and [text] [emoji] on RTL languages."
|
||||
|
||||
@@ -510,6 +510,17 @@ export function getNotificationDataForMessage(
|
||||
};
|
||||
}
|
||||
|
||||
const { poll } = attributes;
|
||||
if (poll) {
|
||||
return {
|
||||
emoji: '📊',
|
||||
text: i18n('icu:message--getNotificationText--poll', {
|
||||
pollQuestion: poll.question,
|
||||
}),
|
||||
bodyRanges,
|
||||
};
|
||||
}
|
||||
|
||||
if (body) {
|
||||
return {
|
||||
text: body,
|
||||
|
||||
Reference in New Issue
Block a user