Skip to content

Commit 88805c7

Browse files
Gargronhiyuki2578
authored andcommitted
Add short_description and approval_required to GET /api/v1/instance (mastodon#11146)
1 parent 17fb373 commit 88805c7

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

app/serializers/rest/instance_serializer.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
class REST::InstanceSerializer < ActiveModel::Serializer
44
include RoutingHelper
55

6-
attributes :uri, :title, :description, :email,
6+
attributes :uri, :title, :short_description, :description, :email,
77
:version, :urls, :stats, :thumbnail,
8-
:max_toot_chars, :languages, :registrations
8+
:max_toot_chars, :languages, :registrations, :approval_required
99

1010
has_one :contact_account, serializer: REST::AccountSerializer
1111

@@ -19,6 +19,10 @@ def title
1919
Setting.site_title
2020
end
2121

22+
def short_description
23+
Setting.site_short_description
24+
end
25+
2226
def description
2327
Setting.site_description
2428
end
@@ -59,6 +63,10 @@ def registrations
5963
Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode
6064
end
6165

66+
def approval_required
67+
Setting.registrations_mode == 'approved'
68+
end
69+
6270
private
6371

6472
def instance_presenter

0 commit comments

Comments
 (0)