about summary refs log tree commit diff
path: root/app/lib/ostatus/activity
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2017-09-01 19:33:02 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-01 12:33:02 +0200
commitaf2d22f88cf84313e11a5f0b1f3a1170f721967e (patch)
tree557c852e167b646c1ae2c31cfff7f6d1385368fa /app/lib/ostatus/activity
parent9a5ae096206df2240ba042efed62854193898a65 (diff)
Fallback from perform_via_activitypub on private posts (#4758)
Currently, private / direct posts via OStatus from AP compatible instance will be dropped due to failing to fetch AP version.

So this fallbacks to OStatus handling:

* when failed to fetch ActivityPub version
* when status is neither :public nor :unlisted
Diffstat (limited to 'app/lib/ostatus/activity')
-rw-r--r--app/lib/ostatus/activity/creation.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/lib/ostatus/activity/creation.rb b/app/lib/ostatus/activity/creation.rb
index 12488ab31..b28239a05 100644
--- a/app/lib/ostatus/activity/creation.rb
+++ b/app/lib/ostatus/activity/creation.rb
@@ -8,7 +8,11 @@ class OStatus::Activity::Creation < OStatus::Activity::Base
     end
 
     return [nil, false] if @account.suspended?
-    return perform_via_activitypub if activitypub_uri?
+
+    if activitypub_uri? && [:public, :unlisted].include?(visibility_scope)
+      result = perform_via_activitypub
+      return result if result.first.present?
+    end
 
     Rails.logger.debug "Creating remote status #{id}"