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

This commit is contained in:
KMY 2025-01-17 16:29:11 +09:00
commit 5d79bd078c
150 changed files with 2982 additions and 1485 deletions

View file

@ -44,7 +44,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
delegate :suspended?, :instance_actor?, to: :object
def id
object.instance_actor? ? instance_actor_url : account_url(object)
ActivityPub::TagManager.instance.uri_for(object)
end
def type
@ -60,27 +60,27 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
end
def following
account_following_index_url(object)
ActivityPub::TagManager.instance.following_uri_for(object)
end
def followers
account_followers_url(object)
ActivityPub::TagManager.instance.followers_uri_for(object)
end
def inbox
object.instance_actor? ? instance_actor_inbox_url : account_inbox_url(object)
ActivityPub::TagManager.instance.inbox_uri_for(object)
end
def outbox
object.instance_actor? ? instance_actor_outbox_url : account_outbox_url(object)
ActivityPub::TagManager.instance.outbox_uri_for(object)
end
def featured
account_collection_url(object, :featured)
ActivityPub::TagManager.instance.collection_uri_for(object, :featured)
end
def featured_tags
account_collection_url(object, :tags)
ActivityPub::TagManager.instance.collection_uri_for(object, :tags)
end
def endpoints

View file

@ -38,6 +38,6 @@ class ActivityPub::AddSerializer < ActivityPub::Serializer
end
def target
account_collection_url(object.account, :featured)
ActivityPub::TagManager.instance.collection_uri_for(object.account, :featured)
end
end

View file

@ -38,6 +38,6 @@ class ActivityPub::RemoveSerializer < ActivityPub::Serializer
end
def target
account_collection_url(object.account, :featured)
ActivityPub::TagManager.instance.collection_uri_for(object.account, :featured)
end
end

View file

@ -8,8 +8,4 @@ class REST::ScheduledStatusSerializer < ActiveModel::Serializer
def id
object.id.to_s
end
def params
object.params.without('application_id')
end
end

View file

@ -1,7 +1,9 @@
# frozen_string_literal: true
class REST::WebPushSubscriptionSerializer < ActiveModel::Serializer
attributes :id, :endpoint, :alerts, :server_key, :policy
attributes :id, :endpoint, :standard, :alerts, :server_key, :policy
delegate :standard, to: :object
def alerts
(object.data&.dig('alerts') || {}).each_with_object({}) { |(k, v), h| h[k] = ActiveModel::Type::Boolean.new.cast(v) }

View file

@ -13,7 +13,7 @@ class WebfingerSerializer < ActiveModel::Serializer
if object.instance_actor?
[instance_actor_url]
else
[short_account_url(object), account_url(object)]
[short_account_url(object), ActivityPub::TagManager.instance.uri_for(object)]
end
end
@ -43,6 +43,6 @@ class WebfingerSerializer < ActiveModel::Serializer
end
def self_href
object.instance_actor? ? instance_actor_url : account_url(object)
ActivityPub::TagManager.instance.uri_for(object)
end
end