mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-20 13:53:30 +00:00
Rename "locked" to "manuallyApprovesFollowers" in ActivityPub (#4779)
See: <https://www.w3.org/wiki/Activity_Streams_extensions#as:manuallyApprovesFollowers>
This commit is contained in:
parent
6ec1aa372d
commit
37fdddd927
|
@ -7,10 +7,9 @@ class ActivityPub::Adapter < ActiveModelSerializers::Adapter::Base
|
||||||
'https://w3id.org/security/v1',
|
'https://w3id.org/security/v1',
|
||||||
|
|
||||||
{
|
{
|
||||||
'locked' => 'as:locked',
|
'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
|
||||||
'sensitive' => 'as:sensitive',
|
'sensitive' => 'as:sensitive',
|
||||||
'Hashtag' => 'as:Hashtag',
|
'Hashtag' => 'as:Hashtag',
|
||||||
|
|
||||||
'ostatus' => 'http://ostatus.org#',
|
'ostatus' => 'http://ostatus.org#',
|
||||||
'atomUri' => 'ostatus:atomUri',
|
'atomUri' => 'ostatus:atomUri',
|
||||||
'inReplyToAtomUri' => 'ostatus:inReplyToAtomUri',
|
'inReplyToAtomUri' => 'ostatus:inReplyToAtomUri',
|
||||||
|
|
|
@ -6,7 +6,7 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
|
||||||
attributes :id, :type, :following, :followers,
|
attributes :id, :type, :following, :followers,
|
||||||
:inbox, :outbox, :shared_inbox,
|
:inbox, :outbox, :shared_inbox,
|
||||||
:preferred_username, :name, :summary,
|
:preferred_username, :name, :summary,
|
||||||
:url, :locked
|
:url, :manually_approves_followers
|
||||||
|
|
||||||
has_one :public_key, serializer: ActivityPub::PublicKeySerializer
|
has_one :public_key, serializer: ActivityPub::PublicKeySerializer
|
||||||
|
|
||||||
|
@ -90,4 +90,8 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
|
||||||
def header_exists?
|
def header_exists?
|
||||||
object.header.exists?
|
object.header.exists?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def manually_approves_followers
|
||||||
|
object.locked
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -50,7 +50,7 @@ class ActivityPub::ProcessAccountService < BaseService
|
||||||
@account.avatar_remote_url = image_url('icon')
|
@account.avatar_remote_url = image_url('icon')
|
||||||
@account.header_remote_url = image_url('image')
|
@account.header_remote_url = image_url('image')
|
||||||
@account.public_key = public_key || ''
|
@account.public_key = public_key || ''
|
||||||
@account.locked = @json['locked'] || false
|
@account.locked = @json['manuallyApprovesFollowers'] || false
|
||||||
@account.save!
|
@account.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue