From eaf9bc1a428b338ee666f1da1e32eed7e3b6b25e Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Tue, 30 Jun 2020 17:33:55 -0500 Subject: [Feature] Add in-place post editing --- app/serializers/activitypub/note_serializer.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/serializers/activitypub/note_serializer.rb') diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index a0965790e..431a0faa4 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -3,12 +3,16 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer context_extensions :atom_uri, :conversation, :sensitive, :voters_count, :direct_message + context_extensions :edited + attributes :id, :type, :summary, :in_reply_to, :published, :url, :attributed_to, :to, :cc, :sensitive, :atom_uri, :in_reply_to_atom_uri, :conversation + attribute :updated + attribute :content attribute :content_map, if: :language? @@ -29,6 +33,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer def id raise Mastodon::NotPermittedError, 'Local-only statuses should not be serialized' if object.local_only? && !instance_options[:allow_local_only] + ActivityPub::TagManager.instance.uri_for(object) end @@ -94,6 +99,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 -- cgit