summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2022-11-14 07:24:46 +0000
committerlain <lain@soykaf.club>2022-11-14 07:24:46 +0000
commit0e1356ef9cc8c97afcc3242cfb8182a706c85276 (patch)
treefd820d358e05339bf70195fe732e3a6151902784 /lib
parent76ed0da09f7422e34feb61c2db151d47b8b92557 (diff)
parent2e0089dd5c27c86488d2c68170d80d02c24135f3 (diff)
Merge branch 'akkoma/delete-improvements' into 'develop'
Alter priority of Delete activities to be lowest See merge request pleroma/pleroma!3782
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/side_effects.ex2
-rw-r--r--lib/pleroma/web/federator.ex9
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/pleroma/web/activity_pub/side_effects.ex b/lib/pleroma/web/activity_pub/side_effects.ex
index 5eefd2824..a2152b945 100644
--- a/lib/pleroma/web/activity_pub/side_effects.ex
+++ b/lib/pleroma/web/activity_pub/side_effects.ex
@@ -282,7 +282,6 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
# Tasks this handles:
# - Delete and unpins the create activity
# - Replace object with Tombstone
- # - Set up notification
# - Reduce the user note count
# - Reduce the reply count
# - Stream out the activity
@@ -324,7 +323,6 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
end
if result == :ok do
- Notification.create_notifications(object)
{:ok, object, meta}
else
{:error, result}
diff --git a/lib/pleroma/web/federator.ex b/lib/pleroma/web/federator.ex
index 3be71c1b6..318b6cb11 100644
--- a/lib/pleroma/web/federator.ex
+++ b/lib/pleroma/web/federator.ex
@@ -47,10 +47,15 @@ defmodule Pleroma.Web.Federator do
end
@impl true
- def publish(activity) do
- PublisherWorker.enqueue("publish", %{"activity_id" => activity.id})
+ def publish(%Pleroma.Activity{data: %{"type" => type}} = activity) do
+ PublisherWorker.enqueue("publish", %{"activity_id" => activity.id},
+ priority: publish_priority(type)
+ )
end
+ defp publish_priority("Delete"), do: 3
+ defp publish_priority(_), do: 0
+
# Job Worker Callbacks
@spec perform(atom(), module(), any()) :: {:ok, any()} | {:error, any()}