Merge commit '7f16397f3c37a8e378239974b73afbfe2b6e6844' into glitch-soc/merge-upstream
Conflicts: - `lib/mastodon/version.rb`: Upstream bumped the mastodon API version, glitch-soc has a change on an adjacent line adding a glitch API version.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::FeatureAuthorizationSerializer < ActivityPub::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :id, :type, :interacting_object, :interaction_target
|
||||
|
||||
def id
|
||||
ap_account_feature_authorization_url(object.account_id, object)
|
||||
end
|
||||
|
||||
def type
|
||||
'FeatureAuthorization'
|
||||
end
|
||||
|
||||
def interaction_target
|
||||
ActivityPub::TagManager.instance.uri_for(object.account)
|
||||
end
|
||||
|
||||
def interacting_object
|
||||
ActivityPub::TagManager.instance.uri_for(object.collection)
|
||||
end
|
||||
end
|
||||
@@ -1,7 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::FeaturedItemSerializer < ActivityPub::Serializer
|
||||
attributes :id, :type, :featured_object, :featured_object_type
|
||||
include RoutingHelper
|
||||
|
||||
attributes :id, :type, :featured_object, :featured_object_type,
|
||||
:feature_authorization
|
||||
|
||||
def id
|
||||
ActivityPub::TagManager.instance.uri_for(object)
|
||||
@@ -18,4 +21,12 @@ class ActivityPub::FeaturedItemSerializer < ActivityPub::Serializer
|
||||
def featured_object_type
|
||||
object.account.actor_type || 'Person'
|
||||
end
|
||||
|
||||
def feature_authorization
|
||||
if object.account.local?
|
||||
ap_account_feature_authorization_url(object.account_id, object)
|
||||
else
|
||||
object.approval_uri
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user