From b9b0313c78ca4efcc8cda089c652be0b333aa16a Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 28 Jul 2019 17:47:37 +0200 Subject: Revert "Remove conversation URI (#11423)" (#11424) This reverts commit 75f7f9930eb2a6f5c4041ec44fe0aa795c9ec449. --- app/serializers/activitypub/note_serializer.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'app/serializers') diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index 88b50b3ea..67f596e78 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -1,13 +1,14 @@ # frozen_string_literal: true class ActivityPub::NoteSerializer < ActivityPub::Serializer - context_extensions :atom_uri, :sensitive, + context_extensions :atom_uri, :conversation, :sensitive, :hashtag, :emoji, :focal_point, :blurhash attributes :id, :type, :summary, :in_reply_to, :published, :url, :attributed_to, :to, :cc, :sensitive, - :atom_uri, :in_reply_to_atom_uri + :atom_uri, :in_reply_to_atom_uri, + :conversation attribute :content attribute :content_map, if: :language? @@ -109,6 +110,16 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer OStatus::TagManager.instance.uri_for(object.thread) end + def conversation + return if object.conversation.nil? + + if object.conversation.uri? + object.conversation.uri + else + OStatus::TagManager.instance.unique_tag(object.conversation.created_at, object.conversation.id, 'Conversation') + end + end + def local? object.account.local? end -- cgit