Update reaction last message notification text

This commit is contained in:
Josh Perez 2022-10-26 18:36:11 -04:00 committed by GitHub
parent db557104a6
commit 13785a0936
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View file

@ -5943,6 +5943,18 @@
"message": "Reacted to a story", "message": "Reacted to a story",
"description": "Used whenever we can't find a user's first name" "description": "Used whenever we can't find a user's first name"
}, },
"Quote__story-reaction-notification--incoming": {
"message": "Reacted $emoji$ to your story",
"description": "Notification test for incoming story reactions"
},
"Quote__story-reaction-notification--outgoing": {
"message": "You reacted $emoji$ to a story from $name$",
"description": "Notification test for outgoing story reactions"
},
"Quote__story-reaction-notification--outgoing--nameless": {
"message": "You reacted $emoji$ to a story",
"description": "Notification test for outgoing story reactions but no name"
},
"Quote__story-unavailable": { "Quote__story-unavailable": {
"message": "No longer available", "message": "No longer available",
"description": "Label for when a story is not found" "description": "Label for when a story is not found"

View file

@ -956,6 +956,30 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
const { attributes } = this; const { attributes } = this;
if (attributes.storyReactionEmoji) { if (attributes.storyReactionEmoji) {
if (attributes.type === 'outgoing') {
const name = this.getConversation()?.get('profileName');
if (!name) {
return window.i18n(
'Quote__story-reaction-notification--outgoing--nameless',
{
emoji: attributes.storyReactionEmoji,
}
);
}
return window.i18n('Quote__story-reaction-notification--outgoing', {
emoji: attributes.storyReactionEmoji,
name,
});
}
if (attributes.type === 'incoming') {
return window.i18n('Quote__story-reaction-notification--incoming', {
emoji: attributes.storyReactionEmoji,
});
}
if (!window.Signal.OS.isLinux()) { if (!window.Signal.OS.isLinux()) {
return attributes.storyReactionEmoji; return attributes.storyReactionEmoji;
} }