]> cat aescling's git repositories - mastodon.git/commitdiff
Add “services” and “metadata” to NodeInfo (#18563)
authorMeisam <39205857+MFTabriz@users.noreply.github.com>
Wed, 1 Jun 2022 14:24:07 +0000 (16:24 +0200)
committeraescling <aescling+gitlab@cat.family>
Sun, 28 Aug 2022 21:14:10 +0000 (17:14 -0400)
* 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

index 7ff8aabecc56c50eddde2294511bc26635a3d646..afae7f00a6c42ac36deb470077cb913168667d65 100644 (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