summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2022-11-14 14:03:11 +0000
committerfeld <feld@feld.me>2022-11-14 14:03:11 +0000
commita9d991d31e5ba00b857dc6f147d50df2473545d3 (patch)
tree3ee87840897c0cf702ad5b543d1b24de90708b31 /lib
parent39b24cdce683471372e2144dc00ed5d0f78740aa (diff)
parent0e1356ef9cc8c97afcc3242cfb8182a706c85276 (diff)
Merge branch 'develop' into 'akoma/deactivated-users'akoma/deactivated-users
# Conflicts: # CHANGELOG.md
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/object/fetcher.ex5
-rw-r--r--lib/pleroma/web/activity_pub/side_effects.ex2
-rw-r--r--lib/pleroma/web/federator.ex9
-rw-r--r--lib/pleroma/web/plugs/http_security_plug.ex2
4 files changed, 13 insertions, 5 deletions
diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex
index d81fdcf24..a9a9eeeed 100644
--- a/lib/pleroma/object/fetcher.ex
+++ b/lib/pleroma/object/fetcher.ex
@@ -4,6 +4,7 @@
defmodule Pleroma.Object.Fetcher do
alias Pleroma.HTTP
+ alias Pleroma.Instances
alias Pleroma.Maps
alias Pleroma.Object
alias Pleroma.Object.Containment
@@ -234,6 +235,10 @@ defmodule Pleroma.Object.Fetcher do
{:ok, body} <- get_object(id),
{:ok, data} <- safe_json_decode(body),
:ok <- Containment.contain_origin_from_id(id, data) do
+ if not Instances.reachable?(id) do
+ Instances.set_reachable(id)
+ end
+
{:ok, data}
else
{:scheme, _} ->
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()}
diff --git a/lib/pleroma/web/plugs/http_security_plug.ex b/lib/pleroma/web/plugs/http_security_plug.ex
index b89948cec..cd1bae235 100644
--- a/lib/pleroma/web/plugs/http_security_plug.ex
+++ b/lib/pleroma/web/plugs/http_security_plug.ex
@@ -68,7 +68,7 @@ defmodule Pleroma.Web.Plugs.HTTPSecurityPlug do
]
}
- [{"reply-to", Jason.encode!(report_group)} | headers]
+ [{"report-to", Jason.encode!(report_group)} | headers]
else
headers
end