ソースを参照

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

master^2
Eugen Rochko 4年前
committed by GitHub
コミット
4e1afef6f9
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更5行の追加1行の削除
  1. +5
    -1
      app/serializers/nodeinfo/serializer.rb

+ 5
- 1
app/serializers/nodeinfo/serializer.rb ファイルの表示

@@ -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


読み込み中…
キャンセル
保存