diff --git a/app/javascript/flavours/glitch/components/status_action_bar.jsx b/app/javascript/flavours/glitch/components/status_action_bar.jsx index be577ccca4..bfdaf6eaaf 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.jsx +++ b/app/javascript/flavours/glitch/components/status_action_bar.jsx @@ -123,7 +123,7 @@ class StatusActionBar extends ImmutablePureComponent { handleEmojiPick = data => { this.props.onReactionAdd(this.props.status.get('id'), data.native.replace(/:/g, ''), data.imageUrl); - } + }; handleReblogClick = e => { const { signedIn } = this.context.identity; @@ -205,7 +205,7 @@ class StatusActionBar extends ImmutablePureComponent { this.props.onAddFilter(this.props.status); }; - handleNoOp = () => {} // hack for reaction add button + handleNoOp = () => {}; // hack for reaction add button render () { const { status, intl, withDismiss, withCounters, showReplyCount, scrollKey } = this.props; diff --git a/app/javascript/flavours/glitch/features/status/index.jsx b/app/javascript/flavours/glitch/features/status/index.jsx index 1cfdda6fde..b580fa66eb 100644 --- a/app/javascript/flavours/glitch/features/status/index.jsx +++ b/app/javascript/flavours/glitch/features/status/index.jsx @@ -320,11 +320,11 @@ class Status extends ImmutablePureComponent { if (signedIn) { dispatch(addReaction(statusId, name, url)); } - } + }; handleReactionRemove = (statusId, name) => { this.props.dispatch(removeReaction(statusId, name)); - } + }; handlePin = (status) => { if (status.get('pinned')) { diff --git a/app/services/unreact_service.rb b/app/services/unreact_service.rb index d449570c7a..37dc1d7c53 100644 --- a/app/services/unreact_service.rb +++ b/app/services/unreact_service.rb @@ -3,21 +3,21 @@ class UnreactService < BaseService include Payloadable -def call(account, status, emoji) - name, domain = emoji.split('@') - custom_emoji = CustomEmoji.find_by(shortcode: name, domain: domain) - reaction = StatusReaction.find_by(account: account, status: status, name: name, custom_emoji: custom_emoji) - return if reaction.nil? + def call(account, status, emoji) + name, domain = emoji.split('@') + custom_emoji = CustomEmoji.find_by(shortcode: name, domain: domain) + reaction = StatusReaction.find_by(account: account, status: status, name: name, custom_emoji: custom_emoji) + return if reaction.nil? - reaction.destroy! + reaction.destroy! - json = Oj.dump(serialize_payload(reaction, ActivityPub::UndoEmojiReactionSerializer)) - if status.account.local? - ActivityPub::RawDistributionWorker.perform_async(json, status.account.id) - else - ActivityPub::DeliveryWorker.perform_async(json, reaction.account_id, status.account.inbox_url) + json = Oj.dump(serialize_payload(reaction, ActivityPub::UndoEmojiReactionSerializer)) + if status.account.local? + ActivityPub::RawDistributionWorker.perform_async(json, status.account.id) + else + ActivityPub::DeliveryWorker.perform_async(json, reaction.account_id, status.account.inbox_url) + end + + reaction end - - reaction - end end diff --git a/config/locales-glitch/en.yml b/config/locales-glitch/en.yml index e88e98191e..7cba60663e 100644 --- a/config/locales-glitch/en.yml +++ b/config/locales-glitch/en.yml @@ -45,3 +45,8 @@ en: body: "%{name} reacted to your post:" subject: "%{name} reacted to your post" title: New reaction + notification_mailer: + reaction: + body: "%{name} reacted to your post:" + subject: "%{name} reacted to your post" + title: New reaction