about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-02-22 18:10:30 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-02-22 18:10:30 +0100
commit1dad72bf13f5e28781a2b2b6654f72624d205576 (patch)
tree27cc73b474b1cce88751a822374431837f24309a /app/models/account.rb
parent709c6685a90bb819696566cc9e42e587546d72dc (diff)
Fixes and general progress
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 90e8d7610..fac835168 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -29,6 +29,18 @@ class Account < ActiveRecord::Base
     self.domain.nil?
   end
 
+  def acct
+    local? ? self.username : "#{self.username}@#{self.domain}"
+  end
+
+  def object_type
+    :person
+  end
+
+  def subscribed?
+    !(self.secret.blank? || self.verify_token.blank?)
+  end
+
   def keypair
     self.private_key.nil? ? OpenSSL::PKey::RSA.new(self.public_key) : OpenSSL::PKey::RSA.new(self.private_key)
   end