projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'feature/remote-user-deactivation' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
activity_pub.ex
diff --git
a/lib/pleroma/web/activity_pub/activity_pub.ex
b/lib/pleroma/web/activity_pub/activity_pub.ex
index 3e1977f967979fb209ecb6747a7d3f9e00269866..973d18e52ba4fc24717d3670d6886f8232248959 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub.ex
@@
-16,9
+16,23
@@
defmodule Pleroma.Web.ActivityPub.ActivityPub do
(data["to"] || []) ++ (data["cc"] || [])
end
(data["to"] || []) ++ (data["cc"] || [])
end
+ defp check_actor_is_active(actor) do
+ if not is_nil(actor) do
+ with user <- User.get_cached_by_ap_id(actor),
+ nil <- user.info["deactivated"] do
+ :ok
+ else
+ _e -> :reject
+ end
+ else
+ :ok
+ end
+ end
+
def insert(map, local \\ true) when is_map(map) do
with nil <- Activity.get_by_ap_id(map["id"]),
map <- lazy_put_activity_defaults(map),
def insert(map, local \\ true) when is_map(map) do
with nil <- Activity.get_by_ap_id(map["id"]),
map <- lazy_put_activity_defaults(map),
+ :ok <- check_actor_is_active(map["actor"]),
{:ok, map} <- MRF.filter(map),
:ok <- insert_full_object(map) do
{:ok, activity} =
{:ok, map} <- MRF.filter(map),
:ok <- insert_full_object(map) do
{:ok, activity} =