Merge pull request #223 from glitch-soc/glitchsoc/feature/configurable-status-size

Make character limit configurable (from tootsuite/mastodon#5697)
This commit is contained in:
beatrix
2017-11-17 19:02:40 -05:00
committed by GitHub
5 changed files with 20 additions and 5 deletions

View File

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