mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-26 12:12:43 +00:00
Implement FEP 7888: Part 1 - publish conversation context (#35959)
This commit is contained in:
parent
9463a31107
commit
65b4a0a6f1
15 changed files with 309 additions and 12 deletions
|
|
@ -70,6 +70,8 @@ class Status < ApplicationRecord
|
|||
belongs_to :reblog, foreign_key: 'reblog_of_id', inverse_of: :reblogs
|
||||
end
|
||||
|
||||
has_one :owned_conversation, class_name: 'Conversation', foreign_key: 'parent_status_id', inverse_of: :parent_status, dependent: nil
|
||||
|
||||
has_many :favourites, inverse_of: :status, dependent: :destroy
|
||||
has_many :bookmarks, inverse_of: :status, dependent: :destroy
|
||||
has_many :reblogs, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblog, dependent: :destroy
|
||||
|
|
@ -442,7 +444,8 @@ class Status < ApplicationRecord
|
|||
self.in_reply_to_account_id = carried_over_reply_to_account_id
|
||||
self.conversation_id = thread.conversation_id if conversation_id.nil?
|
||||
elsif conversation_id.nil?
|
||||
self.conversation = Conversation.new
|
||||
conversation = build_owned_conversation
|
||||
self.conversation = conversation
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue