add max_toot_chars from glitch-soc

This commit is contained in:
Nolan Lawson
2019-02-05 17:47:41 -08:00
committed by Sable
parent da7cd1ab1a
commit 6bd0dadcfd
6 changed files with 20 additions and 6 deletions

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
class StatusLengthValidator < ActiveModel::Validator
MAX_CHARS = 500
MAX_CHARS = (ENV['MAX_TOOT_CHARS'] || 500).to_i
def validate(status)
return unless status.local? && !status.reblog?