+
+
+
+
+
+ {showPushSettings &&
}
+
+
+
+
+
diff --git a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx
index 99ce16749..2936fafdb 100644
--- a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx
+++ b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx
@@ -8,6 +8,7 @@ import { Icon } from 'flavours/glitch/components/icon';
const tooltips = defineMessages({
mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' },
favourites: { id: 'notifications.filter.favourites', defaultMessage: 'Favourites' },
+ reactions: { id: 'notifications.filter.reactions', defaultMessage: 'Reactions' },
boosts: { id: 'notifications.filter.boosts', defaultMessage: 'Boosts' },
polls: { id: 'notifications.filter.polls', defaultMessage: 'Poll results' },
follows: { id: 'notifications.filter.follows', defaultMessage: 'Follows' },
@@ -75,6 +76,13 @@ class FilterBar extends PureComponent {
>
+
);
+ case 'reaction':
+ return (
+
+ );
case 'reblog':
return (
:follow,
'FollowRequest' => :follow_request,
'Favourite' => :favourite,
+ 'StatusReaction' => :reaction,
'Poll' => :poll,
}.freeze
@@ -35,6 +36,7 @@ class Notification < ApplicationRecord
follow
follow_request
favourite
+ reaction
poll
update
admin.sign_up
@@ -46,6 +48,7 @@ class Notification < ApplicationRecord
reblog: [status: :reblog],
mention: [mention: :status],
favourite: [favourite: :status],
+ reaction: [status_reaction: :status],
poll: [poll: :status],
update: :status,
'admin.report': [report: :target_account],
@@ -61,6 +64,7 @@ class Notification < ApplicationRecord
belongs_to :follow, inverse_of: :notification
belongs_to :follow_request, inverse_of: :notification
belongs_to :favourite, inverse_of: :notification
+ belongs_to :status_reaction, inverse_of: :notification
belongs_to :poll, inverse_of: false
belongs_to :report, inverse_of: false
end
@@ -81,6 +85,8 @@ class Notification < ApplicationRecord
status&.reblog
when :favourite
favourite&.status
+ when :reaction
+ status_reaction&.status
when :mention
mention&.status
when :poll
@@ -130,6 +136,8 @@ class Notification < ApplicationRecord
notification.status.reblog = cached_status
when :favourite
notification.favourite.status = cached_status
+ when :reaction
+ notification.reaction.status = cached_status
when :mention
notification.mention.status = cached_status
when :poll
@@ -141,6 +149,8 @@ class Notification < ApplicationRecord
end
end
+ alias reaction status_reaction
+
after_initialize :set_from_account
before_validation :set_from_account
@@ -150,7 +160,7 @@ class Notification < ApplicationRecord
return unless new_record?
case activity_type
- when 'Status', 'Follow', 'Favourite', 'FollowRequest', 'Poll', 'Report'
+ when 'Status', 'Follow', 'Favourite', 'StatusReaction', 'FollowRequest', 'Poll', 'Report'
self.from_account_id = activity&.account_id
when 'Mention'
self.from_account_id = activity&.status&.account_id
diff --git a/app/serializers/rest/notification_serializer.rb b/app/serializers/rest/notification_serializer.rb
index 137fc53dd..93690e444 100644
--- a/app/serializers/rest/notification_serializer.rb
+++ b/app/serializers/rest/notification_serializer.rb
@@ -12,7 +12,7 @@ class REST::NotificationSerializer < ActiveModel::Serializer
end
def status_type?
- [:favourite, :reblog, :status, :mention, :poll, :update].include?(object.type)
+ [:favourite, :reaction, :reblog, :status, :mention, :poll, :update].include?(object.type)
end
def report_type?
diff --git a/app/services/status_reaction_service.rb b/app/services/status_reaction_service.rb
index e823f6bd8..9451690dd 100644
--- a/app/services/status_reaction_service.rb
+++ b/app/services/status_reaction_service.rb
@@ -14,6 +14,7 @@ class StatusReactionService < BaseService
json = Oj.dump(serialize_payload(reaction, ActivityPub::EmojiReactionSerializer))
if status.account.local?
+ NotifyService.new.call(status.account, :reaction, reaction)
ActivityPub::RawDistributionWorker.perform_async(json, status.account.id)
else
ActivityPub::DeliveryWorker.perform_async(json, reaction.account_id, status.account.inbox_url)
diff --git a/config/locales/de.yml b/config/locales/de.yml
index 9cd804abc..112c8dfe6 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -1339,6 +1339,10 @@ de:
body: 'Dein Beitrag wurde von %{name} favorisiert:'
subject: "%{name} favorisierte deinen Beitrag"
title: Neue Favorisierung
+ reaction:
+ body: '%{name} hat auf deinen Beitrag reagiert:'
+ subject: '%{name} hat auf deinen Beitrag reagiert'
+ title: Neue Reaktion
follow:
body: "%{name} folgt dir jetzt!"
subject: "%{name} folgt dir jetzt"
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 83ba4b040..779728694 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1433,6 +1433,10 @@ en:
title: New mention
poll:
subject: A poll by %{name} has ended
+ reaction:
+ body: '%{name} reacted to your post:'
+ subject: '%{name} reacted to your post'
+ title: New reaction
reblog:
body: 'Your post was boosted by %{name}:'
subject: "%{name} boosted your post"
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 5d805f875..f2d758631 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -1323,6 +1323,10 @@ fr:
body: "%{name} a ajouté votre message à ses favoris :"
subject: "%{name} a ajouté votre message à ses favoris"
title: Nouveau favori
+ reaction:
+ body: '%{name} a réagi·e à votre message:'
+ subject: '%{name} a réagi·e à votre message'
+ title: Nouvelle réaction
follow:
body: "%{name} vous suit !"
subject: "%{name} vous suit"