- Use unicode when selecting emoji through picker - Convert shortcodes to unicode when storing text input server-side - Do not convert shortcodes in JS anymore
This commit is contained in:
parent
c42092ba7a
commit
e2685ccc81
15 changed files with 69 additions and 71 deletions
|
@ -47,6 +47,7 @@ class Account < ApplicationRecord
|
|||
include AccountInteractions
|
||||
include Attachmentable
|
||||
include Remotable
|
||||
include EmojiHelper
|
||||
|
||||
# Local users
|
||||
has_one :user, inverse_of: :account
|
||||
|
@ -240,9 +241,18 @@ class Account < ApplicationRecord
|
|||
|
||||
before_create :generate_keys
|
||||
before_validation :normalize_domain
|
||||
before_validation :prepare_contents, if: :local?
|
||||
|
||||
private
|
||||
|
||||
def prepare_contents
|
||||
display_name&.strip!
|
||||
note&.strip!
|
||||
|
||||
self.display_name = emojify(display_name)
|
||||
self.note = emojify(note)
|
||||
end
|
||||
|
||||
def generate_keys
|
||||
return unless local?
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ class Status < ApplicationRecord
|
|||
include Streamable
|
||||
include Cacheable
|
||||
include StatusThreadingConcern
|
||||
include EmojiHelper
|
||||
|
||||
enum visibility: [:public, :unlisted, :private, :direct], _suffix: :visibility
|
||||
|
||||
|
@ -120,7 +121,7 @@ class Status < ApplicationRecord
|
|||
!sensitive? && media_attachments.any?
|
||||
end
|
||||
|
||||
before_validation :prepare_contents
|
||||
before_validation :prepare_contents, if: :local?
|
||||
before_validation :set_reblog
|
||||
before_validation :set_visibility
|
||||
before_validation :set_conversation
|
||||
|
@ -241,6 +242,9 @@ class Status < ApplicationRecord
|
|||
def prepare_contents
|
||||
text&.strip!
|
||||
spoiler_text&.strip!
|
||||
|
||||
self.text = emojify(text)
|
||||
self.spoiler_text = emojify(spoiler_text)
|
||||
end
|
||||
|
||||
def set_reblog
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue