gearheads
/
mastodon
Archived
2
0
Fork 0

Add `openRegistrations` attribute to nodeinfo endpoint (#12058)

gh/stable
Eugen Rochko 2019-10-02 21:02:48 +02:00 committed by GitHub
parent 575dc11cb2
commit 4e1afef6f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -3,7 +3,7 @@
class NodeInfo::Serializer < ActiveModel::Serializer
include RoutingHelper
attributes :version, :software, :protocols, :usage
attributes :version, :software, :protocols, :usage, :open_registrations
def version
'2.0'
@ -33,6 +33,10 @@ class NodeInfo::Serializer < ActiveModel::Serializer
}
end
def open_registrations
Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode
end
private
def instance_presenter