From f5783182c39b07cb119861edb6db6a1c9b2213e9 Mon Sep 17 00:00:00 2001
From: Meisam <39205857+MFTabriz@users.noreply.github.com>
Date: Wed, 1 Jun 2022 16:24:07 +0200
Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9Cservices=E2=80=9D=20and=20?=
 =?UTF-8?q?=E2=80=9Cmetadata=E2=80=9D=20to=20NodeInfo=20(#18563)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* 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
---
 app/serializers/nodeinfo/serializer.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/serializers/nodeinfo/serializer.rb b/app/serializers/nodeinfo/serializer.rb
index 7ff8aabecc..afae7f00a6 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
-- 
GitLab