about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-02-09 19:48:05 +0100
committerGitHub <noreply@github.com>2022-02-09 19:48:05 +0100
commitd602c92b310545eb733a58caed49717341abe27c (patch)
tree59b020274695be37d47d0a4c98962c2677e621e6 /app/models
parent8987ea4d6b236657b8ea97d619902668768ae8ff (diff)
parentd90da7d080d25355290e5d5e86c2c918d685add7 (diff)
Merge pull request #1681 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account_suggestions/global_source.rb2
-rw-r--r--app/models/status_edit.rb6
2 files changed, 7 insertions, 1 deletions
diff --git a/app/models/account_suggestions/global_source.rb b/app/models/account_suggestions/global_source.rb
index 03ed1b6c2..7bca530d4 100644
--- a/app/models/account_suggestions/global_source.rb
+++ b/app/models/account_suggestions/global_source.rb
@@ -6,7 +6,7 @@ class AccountSuggestions::GlobalSource < AccountSuggestions::Source
   end
 
   def get(account, skip_account_ids: [], limit: 40)
-    account_ids = account_ids_for_locale(I18n.locale.to_str.split(/[_-]/).first) - [account.id] - skip_account_ids
+    account_ids = account_ids_for_locale(I18n.locale.to_s.split(/[_-]/).first) - [account.id] - skip_account_ids
 
     as_ordered_suggestions(
       scope(account).where(id: account_ids),
diff --git a/app/models/status_edit.rb b/app/models/status_edit.rb
index a89df86c5..3d8098fe7 100644
--- a/app/models/status_edit.rb
+++ b/app/models/status_edit.rb
@@ -11,6 +11,7 @@
 #  media_attachments_changed :boolean          default(FALSE), not null
 #  created_at                :datetime         not null
 #  updated_at                :datetime         not null
+#  content_type              :string
 #
 
 class StatusEdit < ApplicationRecord
@@ -20,4 +21,9 @@ class StatusEdit < ApplicationRecord
   default_scope { order(id: :asc) }
 
   delegate :local?, to: :status
+
+  def emojis
+    return @emojis if defined?(@emojis)
+    @emojis = CustomEmoji.from_text([spoiler_text, text].join(' '), status.account.domain)
+  end
 end