Merge remote-tracking branch 'parent/main' into upstream-20240624

This commit is contained in:
KMY 2024-06-24 08:38:12 +09:00
commit af2727387e
88 changed files with 703 additions and 597 deletions

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class REST::NotificationSerializer < ActiveModel::Serializer
attributes :id, :type, :created_at
attributes :id, :type, :created_at, :group_key
belongs_to :from_account, key: :account, serializer: REST::AccountSerializer
belongs_to :target_status, key: :status, if: :status_type?, serializer: REST::StatusSerializer
@ -15,6 +15,10 @@ class REST::NotificationSerializer < ActiveModel::Serializer
object.id.to_s
end
def group_key
object.group_key || "ungrouped-#{object.id}"
end
def status_type?
[:favourite, :emoji_reaction, :reaction, :reblog, :status_reference, :status, :list_status, :mention, :poll, :update].include?(object.type)
end