|
@ -16,24 +16,28 @@ class OStatus::Activity::Creation < OStatus::Activity::Base |
|
|
|
|
|
|
|
|
return [status, false] unless status.nil? |
|
|
return [status, false] unless status.nil? |
|
|
|
|
|
|
|
|
status = Status.create!( |
|
|
|
|
|
uri: id, |
|
|
|
|
|
url: url, |
|
|
|
|
|
account: @account, |
|
|
|
|
|
reblog: reblog, |
|
|
|
|
|
text: content, |
|
|
|
|
|
spoiler_text: content_warning, |
|
|
|
|
|
created_at: published, |
|
|
|
|
|
reply: thread?, |
|
|
|
|
|
language: content_language, |
|
|
|
|
|
visibility: visibility_scope, |
|
|
|
|
|
conversation: find_or_create_conversation, |
|
|
|
|
|
thread: thread? ? find_status(thread.first) : nil |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
save_mentions(status) |
|
|
|
|
|
save_hashtags(status) |
|
|
|
|
|
save_media(status) |
|
|
|
|
|
|
|
|
cached_reblog = reblog |
|
|
|
|
|
|
|
|
|
|
|
ApplicationRecord.transaction do |
|
|
|
|
|
status = Status.create!( |
|
|
|
|
|
uri: id, |
|
|
|
|
|
url: url, |
|
|
|
|
|
account: @account, |
|
|
|
|
|
reblog: cached_reblog, |
|
|
|
|
|
text: content, |
|
|
|
|
|
spoiler_text: content_warning, |
|
|
|
|
|
created_at: published, |
|
|
|
|
|
reply: thread?, |
|
|
|
|
|
language: content_language, |
|
|
|
|
|
visibility: visibility_scope, |
|
|
|
|
|
conversation: find_or_create_conversation, |
|
|
|
|
|
thread: thread? ? find_status(thread.first) : nil |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
save_mentions(status) |
|
|
|
|
|
save_hashtags(status) |
|
|
|
|
|
save_media(status) |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
if thread? && status.thread.nil? |
|
|
if thread? && status.thread.nil? |
|
|
Rails.logger.debug "Trying to attach #{status.id} (#{id}) to #{thread.first}" |
|
|
Rails.logger.debug "Trying to attach #{status.id} (#{id}) to #{thread.first}" |
|
|