diff options
author | beatrix <beatrix.bitrot@gmail.com> | 2017-11-17 19:02:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-17 19:02:40 -0500 |
commit | 5a9982b425d3db65d813eb0314a27cea16f0f52d (patch) | |
tree | eabdb52c5d75421876397720b5b79e270ea705e9 /app/serializers/rest/instance_serializer.rb | |
parent | 284e2cde81811d6289dde9542f9c987062f9e7c2 (diff) | |
parent | dc16d73bf5f3e7db54e4f21848f40cff3d9172ca (diff) |
Merge pull request #223 from glitch-soc/glitchsoc/feature/configurable-status-size
Make character limit configurable (from tootsuite/mastodon#5697)
Diffstat (limited to 'app/serializers/rest/instance_serializer.rb')
-rw-r--r-- | app/serializers/rest/instance_serializer.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/serializers/rest/instance_serializer.rb b/app/serializers/rest/instance_serializer.rb index 2898011fd..abbacc374 100644 --- a/app/serializers/rest/instance_serializer.rb +++ b/app/serializers/rest/instance_serializer.rb @@ -4,7 +4,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer include RoutingHelper attributes :uri, :title, :description, :email, - :version, :urls, :stats, :thumbnail + :version, :urls, :stats, :thumbnail, :max_toot_chars def uri Rails.configuration.x.local_domain @@ -30,6 +30,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer full_asset_url(instance_presenter.thumbnail.file.url) if instance_presenter.thumbnail end + def max_toot_chars + StatusLengthValidator::MAX_CHARS + end + def stats { user_count: instance_presenter.user_count, |