Fix: #795 通知のグルーピング時、リストの新着投稿通知が表示されない (#800)

This commit is contained in:
KMY(雪あすか) 2024-08-17 09:57:16 +09:00 committed by GitHub
parent f0acd992c5
commit c37aba43f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 110 additions and 6 deletions

View file

@ -13,6 +13,7 @@ class REST::NotificationGroupSerializer < ActiveModel::Serializer
belongs_to :report, if: :report_type?, serializer: REST::ReportSerializer
belongs_to :account_relationship_severance_event, key: :event, if: :relationship_severance_event?, serializer: REST::AccountRelationshipSeveranceEventSerializer
belongs_to :account_warning, key: :moderation_warning, if: :moderation_warning_event?, serializer: REST::AccountWarningSerializer
has_one :list, if: :list_status_type?, serializer: REST::ListSerializer
def sample_account_ids
object.sample_accounts.pluck(:id).map(&:to_s)
@ -23,7 +24,7 @@ class REST::NotificationGroupSerializer < ActiveModel::Serializer
end
def status_type?
[:favourite, :emoji_reaction, :reblog, :status, :mention, :status_reference, :poll, :update].include?(object.type)
[:favourite, :emoji_reaction, :reblog, :status, :mention, :status_reference, :poll, :update, :list_status].include?(object.type)
end
def report_type?
@ -34,6 +35,10 @@ class REST::NotificationGroupSerializer < ActiveModel::Serializer
object.type == :emoji_reaction
end
def list_status_type?
object.type == :list_status
end
def relationship_severance_event?
object.type == :severed_relationships
end