about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/activitypub/activity_serializer.rb6
-rw-r--r--app/serializers/activitypub/note_serializer.rb6
-rw-r--r--app/serializers/rest/account_serializer.rb6
-rw-r--r--app/serializers/rest/status_serializer.rb6
4 files changed, 16 insertions, 8 deletions
diff --git a/app/serializers/activitypub/activity_serializer.rb b/app/serializers/activitypub/activity_serializer.rb
index 21386ab8a..799f9329f 100644
--- a/app/serializers/activitypub/activity_serializer.rb
+++ b/app/serializers/activitypub/activity_serializer.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 class ActivityPub::ActivitySerializer < ActivityPub::Serializer
-  attributes :id, :type, :actor, :published, :to, :cc
+  attributes :id, :type, :actor, :published, :updated, :to, :cc
 
   has_one :proper, key: :object, serializer: ActivityPub::NoteSerializer, if: :serialize_object?
   attribute :proper_uri, key: :object, unless: :serialize_object?
@@ -22,6 +22,10 @@ class ActivityPub::ActivitySerializer < ActivityPub::Serializer
     object.created_at.iso8601
   end
 
+  def updated
+    object.updated_at.iso8601
+  end
+
   def to
     ActivityPub::TagManager.instance.to(object)
   end
diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb
index ff39c97c4..cbabc275c 100644
--- a/app/serializers/activitypub/note_serializer.rb
+++ b/app/serializers/activitypub/note_serializer.rb
@@ -6,7 +6,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
                      :reject_replies
 
   attributes :id, :type, :summary,
-             :in_reply_to, :published, :url,
+             :in_reply_to, :published, :updated, :url,
              :attributed_to, :to, :cc, :sensitive,
              :conversation, :source, :tails_never_fail,
              :reject_replies
@@ -85,6 +85,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
     object.created_at.iso8601
   end
 
+  def updated
+    object.updated_at.iso8601
+  end
+
   def url
     ActivityPub::TagManager.instance.url_for(object)
   end
diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb
index 509b688db..3e826aaf3 100644
--- a/app/serializers/rest/account_serializer.rb
+++ b/app/serializers/rest/account_serializer.rb
@@ -4,9 +4,9 @@ class REST::AccountSerializer < ActiveModel::Serializer
   include RoutingHelper
 
   attributes :id, :username, :acct, :display_name, :locked, :bot, :created_at,
-             :note, :url, :avatar, :avatar_static, :header, :header_static,
-             :followers_count, :following_count, :statuses_count, :replies,
-             :adult_content, :gently, :kobold, :role, :froze, :identity,
+             :updated_at, :note, :url, :avatar, :avatar_static, :header,
+             :header_static, :followers_count, :following_count, :statuses_count,
+             :replies, :adult_content, :gently, :kobold, :role, :froze, :identity,
              :limited, :signature
 
   has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb
index 86c63e772..75a1dc591 100644
--- a/app/serializers/rest/status_serializer.rb
+++ b/app/serializers/rest/status_serializer.rb
@@ -3,9 +3,9 @@
 class REST::StatusSerializer < ActiveModel::Serializer
   include Redisable
 
-  attributes :id, :created_at, :in_reply_to_id, :in_reply_to_account_id,
-             :sensitive, :spoiler_text, :visibility, :language,
-             :uri, :url, :replies_count, :reblogs_count,
+  attributes :id, :created_at, :updated_at, :in_reply_to_id,
+             :in_reply_to_account_id, :sensitive, :spoiler_text, :visibility,
+             :language, :uri, :url, :replies_count, :reblogs_count,
              :favourites_count, :network, :curated, :reject_replies
 
   attribute :favourited, if: :current_user?