Merge commit '651e51a82eba542c4d8c3fec5edd16420ea1ff3e' into glitch-soc/merge-upstream
Conflicts: - `yarn.lock`: Upstream updated a dependency textually adjacent to a glitch-soc-specific one. Updated the dependency as upstream did.
This commit is contained in:
commit
4d9150735a
86 files changed
+2659
-1164
No files matched your search
@@ -116,7 +116,7 @@ class Account < ApplicationRecord
|
||||
|
||||
# Local user validations
|
||||
validates :username, format: { with: /\A[a-z0-9_]+\z/i }, length: { maximum: USERNAME_LENGTH_LIMIT }, if: -> { local? && will_save_change_to_username? && !actor_type_application? }
|
||||
validates_with UnreservedUsernameValidator, if: -> { local? && will_save_change_to_username? && !actor_type_application? }
|
||||
validates_with UnreservedUsernameValidator, if: -> { local? && will_save_change_to_username? && !actor_type_application? && !user&.bypass_registration_checks }
|
||||
validates :display_name, length: { maximum: DISPLAY_NAME_LENGTH_LIMIT }, if: -> { local? && will_save_change_to_display_name? }
|
||||
validates :note, note_length: { maximum: NOTE_LENGTH_LIMIT }, if: -> { local? && will_save_change_to_note? }
|
||||
validates :fields, length: { maximum: DEFAULT_FIELDS_SIZE }, if: -> { local? && will_save_change_to_fields? }
|
||||
|
||||
@@ -10,6 +10,10 @@ module Status::InteractionPolicyConcern
|
||||
followed: (1 << 3),
|
||||
}.freeze
|
||||
|
||||
included do
|
||||
before_validation :downgrade_quote_policy, if: -> { local? && !distributable? }
|
||||
end
|
||||
|
||||
def quote_policy_as_keys(kind)
|
||||
case kind
|
||||
when :automatic
|
||||
@@ -52,4 +56,8 @@ module Status::InteractionPolicyConcern
|
||||
|
||||
:denied
|
||||
end
|
||||
|
||||
def downgrade_quote_policy
|
||||
self.quote_approval_policy = 0
|
||||
end
|
||||
end
|
||||
@@ -43,7 +43,7 @@ class CustomEmoji < ApplicationRecord
|
||||
|
||||
has_attached_file :image, styles: { static: { format: 'png', convert_options: '-coalesce +profile "!icc,*" +set date:modify +set date:create +set date:timestamp', file_geometry_parser: FastGeometryParser } }, validate_media_type: false, processors: [:lazy_thumbnail]
|
||||
|
||||
normalizes :domain, with: ->(domain) { domain.downcase }
|
||||
normalizes :domain, with: ->(domain) { domain.downcase.strip }
|
||||
|
||||
validates_attachment :image, content_type: { content_type: IMAGE_MIME_TYPES }, presence: true
|
||||
validates_attachment_size :image, less_than: LIMIT, unless: :local?
|
||||
|
||||
@@ -35,7 +35,7 @@ class CustomEmojiFilter
|
||||
when 'remote'
|
||||
CustomEmoji.remote
|
||||
when 'by_domain'
|
||||
CustomEmoji.where(domain: value.strip.downcase)
|
||||
CustomEmoji.where(domain: value)
|
||||
when 'shortcode'
|
||||
CustomEmoji.search(value.strip)
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user