diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-01-19 18:28:37 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-01-19 18:28:37 +0100 |
commit | 5e0cf92fd145b27053389e5ffcce48da77439713 (patch) | |
tree | 27e1567b240f1a3117de595413ccceb9222d8465 /app/lib/activitypub/activity/create.rb | |
parent | 530d29148ca0c5bf29f6fa516b1ef4f91d95894b (diff) | |
parent | 7c3fddeab4c4ddebca7d5441ac67870aa1cecfe4 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
No conflicts.
Diffstat (limited to 'app/lib/activitypub/activity/create.rb')
-rw-r--r-- | app/lib/activitypub/activity/create.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 2b238bc88..b49657d4b 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -5,10 +5,13 @@ class ActivityPub::Activity::Create < ActivityPub::Activity CONVERTED_TYPES = %w(Image Video Article Page).freeze def perform - return if delete_arrived_first?(object_uri) || unsupported_object_type? || invalid_origin?(@object['id']) + return if unsupported_object_type? || invalid_origin?(@object['id']) + return if Tombstone.exists?(uri: @object['id']) RedisLock.acquire(lock_options) do |lock| if lock.acquired? + return if delete_arrived_first?(object_uri) + @status = find_existing_status if @status.nil? @@ -59,7 +62,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity 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?, @@ -254,7 +257,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity 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'] |