Add searchability support

This commit is contained in:
KMY 2023-04-06 04:27:52 +09:00
parent a2e674af51
commit af20b1d2aa
43 changed files with 716 additions and 65 deletions

View file

@ -3,13 +3,13 @@
class ActivityPub::NoteSerializer < ActivityPub::Serializer
include FormattingHelper
context_extensions :atom_uri, :conversation, :sensitive, :voters_count
context_extensions :atom_uri, :conversation, :sensitive, :voters_count, :searchable_by
attributes :id, :type, :summary,
:in_reply_to, :published, :url,
:attributed_to, :to, :cc, :sensitive,
:atom_uri, :in_reply_to_atom_uri,
:conversation
:conversation, :searchable_by
attribute :content
attribute :content_map, if: :language?
@ -138,6 +138,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
end
end
def searchable_by
ActivityPub::TagManager.instance.searchable_by(object)
end
def local?
object.account.local?
end