* Add: `conversations`テーブルに`ancestor_status`プロパティ * Fix test * Fix test more * Add: `limited_visibility`に`Reply`を追加、`context`のURI * Add: 外部からの`context`受信処理 * Fix test * Add: 公開範囲「返信」 * Fix test * Fix: 返信に返信以外の公開範囲を設定できない問題 * Add: ローカル投稿時にメンション追加・他サーバーへの転送 * Fix test * Fix test * Test: ローカルスレッドへの返信投稿の転送 * Test: 未知のアカウントからのメンション * Add: 編集・削除の連合に対応 * Remove: 重複テスト * Fix: 改善 * Add: 編集削除の転送処理・返信なのにsilentなメンションでの通知 * Fix: リプライが第三者に届かない問題 * Add: `always_sign_unsafe` * Add: Subject * Remove space * Fix: 他人のスレッドの送信先一覧を非表示 * Fix: おかしいコード
This commit is contained in:
parent
a52a8ce214
commit
a88349af55
42 changed files with 1115 additions and 77 deletions
21
app/serializers/activitypub/context_serializer.rb
Normal file
21
app/serializers/activitypub/context_serializer.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::ContextSerializer < ActivityPub::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :id, :type, :inbox
|
||||
|
||||
def id
|
||||
ActivityPub::TagManager.instance.uri_for(object)
|
||||
end
|
||||
|
||||
def type
|
||||
'Group'
|
||||
end
|
||||
|
||||
def inbox
|
||||
return '' if object.ancestor_status.nil?
|
||||
|
||||
account_inbox_url(object.ancestor_status.account)
|
||||
end
|
||||
end
|
|
@ -9,11 +9,12 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
|||
:in_reply_to, :published, :url,
|
||||
:attributed_to, :to, :cc, :sensitive,
|
||||
:atom_uri, :in_reply_to_atom_uri,
|
||||
:conversation, :searchable_by, :limited_scope
|
||||
:conversation, :searchable_by, :context
|
||||
|
||||
attribute :content
|
||||
attribute :content_map, if: :language?
|
||||
attribute :updated, if: :edited?
|
||||
attribute :limited_scope, if: :limited_visibility?
|
||||
|
||||
attribute :quote_uri, if: :quote?
|
||||
attribute :misskey_quote, key: :_misskey_quote, if: :quote?
|
||||
|
@ -52,6 +53,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
|||
{ object.language => content }
|
||||
end
|
||||
|
||||
def context
|
||||
ActivityPub::TagManager.instance.uri_for(object.conversation)
|
||||
end
|
||||
|
||||
def replies
|
||||
replies = object.self_replies(5).pluck(:id, :uri)
|
||||
last_id = replies.last&.first
|
||||
|
@ -88,6 +93,8 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
|||
object.language.present?
|
||||
end
|
||||
|
||||
delegate :limited_visibility?, to: :object
|
||||
|
||||
delegate :edited?, to: :object
|
||||
|
||||
def in_reply_to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue