0
0
Fork 0

Fix #4149, fix #1199 - Store emojis as unicode (#4189)

- 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:
Eugen Rochko 2017-07-14 19:47:53 +02:00 committed by GitHub
parent c42092ba7a
commit e2685ccc81
15 changed files with 69 additions and 71 deletions

View file

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