about summary refs log tree commit diff
path: root/app/serializers/rest/account_serializer.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-11-18 19:39:02 +0100
committerGitHub <noreply@github.com>2017-11-18 19:39:02 +0100
commit58cede4808baa4db6cc143b80ef23e8179a8415b (patch)
treeacaac099fc46d9293768f9fa70c1d1826d06d7e8 /app/serializers/rest/account_serializer.rb
parent6be72a3ec6d87af4de245b96fea45191ac01114e (diff)
Profile redirect notes (#5746)
* Serialize moved accounts into REST and ActivityPub APIs

* Parse federated moved accounts from ActivityPub

* Add note about moved accounts to public profiles

* Add moved account message to web UI

* Fix code style issues
Diffstat (limited to 'app/serializers/rest/account_serializer.rb')
-rw-r--r--app/serializers/rest/account_serializer.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb
index 65fdb0308..bab944c5a 100644
--- a/app/serializers/rest/account_serializer.rb
+++ b/app/serializers/rest/account_serializer.rb
@@ -7,6 +7,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
              :note, :url, :avatar, :avatar_static, :header, :header_static,
              :followers_count, :following_count, :statuses_count
 
+  has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved?
+
+  delegate :moved?, to: :object
+
   def id
     object.id.to_s
   end