about summary refs log tree commit diff
path: root/app/serializers/nodeinfo
diff options
context:
space:
mode:
authorMeisam <39205857+MFTabriz@users.noreply.github.com>2022-06-01 16:24:07 +0200
committerGitHub <noreply@github.com>2022-06-01 16:24:07 +0200
commitf5783182c39b07cb119861edb6db6a1c9b2213e9 (patch)
tree37c3b574f7de535df945ea1edb2cbbb0f8987aea /app/serializers/nodeinfo
parent129de8e4c7535b7c46bc3ce65fb3a2808e23d2a8 (diff)
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
Diffstat (limited to 'app/serializers/nodeinfo')
-rw-r--r--app/serializers/nodeinfo/serializer.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/serializers/nodeinfo/serializer.rb b/app/serializers/nodeinfo/serializer.rb
index 7ff8aabec..afae7f00a 100644
--- a/app/serializers/nodeinfo/serializer.rb
+++ b/app/serializers/nodeinfo/serializer.rb
@@ -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