|
|
@ -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!(
|
|
|
|
cached_reblog = reblog
|
|
|
|
uri: id,
|
|
|
|
|
|
|
|
url: url,
|
|
|
|
ApplicationRecord.transaction do
|
|
|
|
account: @account,
|
|
|
|
status = Status.create!(
|
|
|
|
reblog: reblog,
|
|
|
|
uri: id,
|
|
|
|
text: content,
|
|
|
|
url: url,
|
|
|
|
spoiler_text: content_warning,
|
|
|
|
account: @account,
|
|
|
|
created_at: published,
|
|
|
|
reblog: cached_reblog,
|
|
|
|
reply: thread?,
|
|
|
|
text: content,
|
|
|
|
language: content_language,
|
|
|
|
spoiler_text: content_warning,
|
|
|
|
visibility: visibility_scope,
|
|
|
|
created_at: published,
|
|
|
|
conversation: find_or_create_conversation,
|
|
|
|
reply: thread?,
|
|
|
|
thread: thread? ? find_status(thread.first) : nil
|
|
|
|
language: content_language,
|
|
|
|
)
|
|
|
|
visibility: visibility_scope,
|
|
|
|
|
|
|
|
conversation: find_or_create_conversation,
|
|
|
|
save_mentions(status)
|
|
|
|
thread: thread? ? find_status(thread.first) : nil
|
|
|
|
save_hashtags(status)
|
|
|
|
)
|
|
|
|
save_media(status)
|
|
|
|
|
|
|
|
|
|
|
|
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}"
|
|
|
|