Skip to content

Commit

Permalink
Use summary as summary for converted ActivityPub objects (mastodon#9823)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and hiyuki2578 committed Oct 2, 2019
1 parent c455860 commit 6dd8ce0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/lib/activitypub/activity/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def process_status_params
account: @account,
text: text_from_content || '',
language: detected_language,
spoiler_text: text_from_summary || '',
spoiler_text: converted_object_type? ? '' : (text_from_summary || ''),
created_at: @object['published'],
override_timestamps: @options[:override_timestamps],
reply: @object['inReplyTo'].present?,
Expand Down Expand Up @@ -256,7 +256,7 @@ def in_reply_to_uri
end

def text_from_content
return Formatter.instance.linkify([text_from_name, object_url || @object['id']].join(' ')) if converted_object_type?
return Formatter.instance.linkify([[text_from_name, text_from_summary.presence].compact.join("\n\n"), object_url || @object['id']].join(' ')) if converted_object_type?

if @object['content'].present?
@object['content']
Expand Down

0 comments on commit 6dd8ce0

Please sign in to comment.