+
+
+
+
+
+ {showPushSettings &&
}
+
+
+
+
+
diff --git a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js
index c1de0f90ea..6027a55d85 100644
--- a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js
+++ b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js
@@ -6,6 +6,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' },
@@ -74,6 +75,13 @@ class FilterBar extends React.PureComponent {
>
+
);
+ case 'reaction':
+ return (
+
+ );
case 'reblog':
return (
:mention,
- 'Status' => :reblog,
- 'Follow' => :follow,
- 'FollowRequest' => :follow_request,
- 'Favourite' => :favourite,
- 'Poll' => :poll,
+ 'Mention' => :mention,
+ 'Status' => :reblog,
+ 'Follow' => :follow,
+ 'FollowRequest' => :follow_request,
+ 'Favourite' => :favourite,
+ 'StatusReaction' => :reaction,
+ 'Poll' => :poll,
}.freeze
TYPES = %i(
@@ -34,6 +35,7 @@ class Notification < ApplicationRecord
follow
follow_request
favourite
+ reaction
poll
update
admin.sign_up
@@ -45,6 +47,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],
@@ -54,13 +57,14 @@ class Notification < ApplicationRecord
belongs_to :from_account, class_name: 'Account', optional: true
belongs_to :activity, polymorphic: true, optional: true
- belongs_to :mention, foreign_key: 'activity_id', optional: true
- belongs_to :status, foreign_key: 'activity_id', optional: true
- belongs_to :follow, foreign_key: 'activity_id', optional: true
- belongs_to :follow_request, foreign_key: 'activity_id', optional: true
- belongs_to :favourite, foreign_key: 'activity_id', optional: true
- belongs_to :poll, foreign_key: 'activity_id', optional: true
- belongs_to :report, foreign_key: 'activity_id', optional: true
+ belongs_to :mention, foreign_key: 'activity_id', optional: true
+ belongs_to :status, foreign_key: 'activity_id', optional: true
+ belongs_to :follow, foreign_key: 'activity_id', optional: true
+ belongs_to :follow_request, foreign_key: 'activity_id', optional: true
+ belongs_to :favourite, foreign_key: 'activity_id', optional: true
+ belongs_to :poll, foreign_key: 'activity_id', optional: true
+ belongs_to :report, foreign_key: 'activity_id', optional: true
+ belongs_to :status_reaction, foreign_key: 'activity_id', optional: true
validates :type, inclusion: { in: TYPES }
@@ -78,6 +82,8 @@ class Notification < ApplicationRecord
status&.reblog
when :favourite
favourite&.status
+ when :reaction
+ status_reaction&.status
when :mention
mention&.status
when :poll
@@ -129,6 +135,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
@@ -140,6 +148,8 @@ class Notification < ApplicationRecord
end
end
+ alias reaction status_reaction
+
after_initialize :set_from_account
before_validation :set_from_account
@@ -149,7 +159,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 137fc53dda..93690e444a 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 e823f6bd88..9451690dd1 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 8a12a30470..1899b131d1 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -1285,6 +1285,10 @@ de:
body: 'Dein Beitrag wurde von %{name} favorisiert:'
subject: "%{name} hat deinen Beitrag favorisiert"
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 075ce2136f..bf43d0c752 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1292,6 +1292,10 @@ en:
body: 'Your post was favourited by %{name}:'
subject: "%{name} favourited your post"
title: New favourite
+ reaction:
+ body: '%{name} reacted to your post:'
+ subject: '%{name} reacted to your post'
+ title: New reaction
follow:
body: "%{name} is now following you!"
subject: "%{name} is now following you"
diff --git a/config/locales/en_GB.yml b/config/locales/en_GB.yml
index 2cba40da0b..80084d9a6f 100644
--- a/config/locales/en_GB.yml
+++ b/config/locales/en_GB.yml
@@ -707,6 +707,10 @@ en_GB:
body: 'Your status was favourited by %{name}:'
subject: "%{name} favourited your status"
title: New favourite
+ reaction:
+ body: '%{name} reacted on your post with %{reaction}:'
+ subject: '%{name} reacted on your post'
+ title: New reaction
follow:
body: "%{name} is now following you!"
subject: "%{name} is now following you"
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index b24603db98..9f3cf843a1 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -1285,6 +1285,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"