projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply 1 suggestion(s) to 1 file(s)
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
object_validators
/
common_fixes.ex
diff --git
a/lib/pleroma/web/activity_pub/object_validators/common_fixes.ex
b/lib/pleroma/web/activity_pub/object_validators/common_fixes.ex
index 721749de0c5611d5fe29ccfb43d5732b5ac2c9ca..b3638cfc7542bec650288c0482efbbae908f17d4 100644
(file)
--- a/
lib/pleroma/web/activity_pub/object_validators/common_fixes.ex
+++ b/
lib/pleroma/web/activity_pub/object_validators/common_fixes.ex
@@
-3,6
+3,7
@@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes do
+ alias Pleroma.Object.Containment
alias Pleroma.Web.ActivityPub.Utils
# based on Pleroma.Web.ActivityPub.Utils.lazy_put_objects_defaults
alias Pleroma.Web.ActivityPub.Utils
# based on Pleroma.Web.ActivityPub.Utils.lazy_put_objects_defaults
@@
-11,12
+12,20
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes do
Utils.create_context(data["context"] || data["conversation"])
data
Utils.create_context(data["context"] || data["conversation"])
data
- |> Map.put
_new
("context", context)
- |> Map.put
_new
("context_id", context_id)
+ |> Map.put("context", context)
+ |> Map.put("context_id", context_id)
end
def fix_attribution(data) do
data
|> Map.put_new("actor", data["attributedTo"])
end
end
def fix_attribution(data) do
data
|> Map.put_new("actor", data["attributedTo"])
end
+
+ def fix_actor(data) do
+ actor = Containment.get_actor(data)
+
+ data
+ |> Map.put("actor", actor)
+ |> Map.put("attributedTo", actor)
+ end
end
end