Skip to content

Commit

Permalink
Update reaction last message notification text
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Perez <60019601+josh-signal@users.noreply.github.com>
  • Loading branch information
automated-signal and josh-signal committed Oct 26, 2022
1 parent f60e24f commit 024d665
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions _locales/en/messages.json
Expand Up @@ -5915,6 +5915,18 @@
"message": "Reacted to a story",
"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": {
"message": "No longer available",
"description": "Label for when a story is not found"
Expand Down
24 changes: 24 additions & 0 deletions ts/models/messages.ts
Expand Up @@ -956,6 +956,30 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
const { attributes } = this;

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()) {
return attributes.storyReactionEmoji;
}
Expand Down

0 comments on commit 024d665

Please sign in to comment.