浏览代码

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


正在加载...
取消
保存