diff --git a/_locales/en/messages.json b/_locales/en/messages.json index b5646cdd72..f264bb16ca 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -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." diff --git a/ts/util/getNotificationDataForMessage.preload.ts b/ts/util/getNotificationDataForMessage.preload.ts index fe6714b3af..acaa217e2e 100644 --- a/ts/util/getNotificationDataForMessage.preload.ts +++ b/ts/util/getNotificationDataForMessage.preload.ts @@ -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,