about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-11-06 02:12:37 -0600
committermultiple creatures <dev@multiple-creature.party>2019-11-06 02:12:37 -0600
commitd162ebae794e5a3890e1f7c9c498aa0b039a4fe9 (patch)
treef48cb0ff1af6eddd619e994814c02e741ed4bdf7
parentfacde93c4df94be5d2eafd1d79f17e111a9e9e76 (diff)
remove undeliverable flag from temporarily offline remote accounts & servers if something is successfully received from them
-rw-r--r--app/lib/activitypub/activity/create.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb
index 4367344ab..6ba417b3d 100644
--- a/app/lib/activitypub/activity/create.rb
+++ b/app/lib/activitypub/activity/create.rb
@@ -38,6 +38,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
         elsif @options[:delivered_to_account_id].present?
           postprocess_audience_and_deliver
         end
+
+        clear_unavail
       else
         raise Mastodon::RaceConditionError
       end
@@ -48,6 +50,14 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
 
   private
 
+  def clear_unavail
+    inboxes = [@account.inbox_url, @account.preferred_inbox_url, @account.shared_inbox_url].uniq
+    inboxes.each do |inbox|
+      Redis.current.del("exhausted_deliveries:#{inbox}")
+      Redis.current.srem(inbox)
+    end
+  end
+
   def process_status
     @tags     = []
     @mentions = []