Add “services” and “metadata” to NodeInfo (#18563)

* add services to NodeInfo response

* add metadata to NodeInfo response

* learning ruby syntax!

* patch the patch

* rm trailing whitespace

* use [] instead of empty array constructor
rebase/4.0.0rc2
Meisam 2022-06-01 16:24:07 +02:00 committed by GitHub
parent 129de8e4c7
commit f5783182c3
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, :open_registrations
attributes :version, :software, :protocols, :services, :usage, :open_registrations, :metadata
def version
'2.0'
@ -37,6 +37,10 @@ class NodeInfo::Serializer < ActiveModel::Serializer
Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode
end
def metadata
[]
end
private
def instance_presenter