about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-04 20:44:06 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-04 20:44:06 -0600
commit8eaba1b6f933bf72d5434d5a6f0ddbd3e62228f6 (patch)
treedc87eb7efce86ff9c652a956c51c6148e6cbe51d /app/models
parent266f74ff1c64cf4d3fb0a1a658e666cd0d73fa46 (diff)
lazily merge accounts helper & necessary methods from glitchsoc 3.0
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 63b026467..3993f450f 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -213,6 +213,10 @@ class Account < ApplicationRecord
     local? ? username : "#{username}@#{domain}"
   end
 
+  def pretty_acct
+    local? ? username : "#{username}@#{Addressable::IDNA.to_unicode(domain)}"
+  end
+
   def local_username_and_domain
     "#{username}@#{Rails.configuration.x.local_domain}"
   end
@@ -225,6 +229,10 @@ class Account < ApplicationRecord
     "acct:#{local_username_and_domain}"
   end
 
+  def searchable?
+    !(suspended? || moved?)
+  end
+
   def possibly_stale?
     last_webfingered_at.nil? || last_webfingered_at <= 1.day.ago
   end