projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'outbox_pagination' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
transmogrifier.ex
diff --git
a/lib/pleroma/web/activity_pub/transmogrifier.ex
b/lib/pleroma/web/activity_pub/transmogrifier.ex
index acd61bda3c19905a56c7b999f9620ae1343595e3..5878fb4f805625eda1a08febac7342471372de81 100644
(file)
--- a/
lib/pleroma/web/activity_pub/transmogrifier.ex
+++ b/
lib/pleroma/web/activity_pub/transmogrifier.ex
@@
-15,6
+15,7
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.ActivityPub.Visibility
alias Pleroma.Web.Federator
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.ActivityPub.Visibility
alias Pleroma.Web.Federator
+ alias Pleroma.Workers.TransmogrifierWorker
import Ecto.Query
import Ecto.Query
@@
-185,12
+186,12
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|> Map.put("context", replied_object.data["context"] || object["conversation"])
else
e ->
|> Map.put("context", replied_object.data["context"] || object["conversation"])
else
e ->
- Logger.error("Couldn't fetch
\"#{inspect(in_reply_to_id)}\"
, error: #{inspect(e)}")
+ Logger.error("Couldn't fetch
#{inspect(in_reply_to_id)}
, error: #{inspect(e)}")
object
end
e ->
object
end
e ->
- Logger.error("Couldn't fetch
\"#{inspect(in_reply_to_id)}\"
, error: #{inspect(e)}")
+ Logger.error("Couldn't fetch
#{inspect(in_reply_to_id)}
, error: #{inspect(e)}")
object
end
else
object
end
else
@@
-978,15
+979,7
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
defp strip_internal_fields(object) do
object
defp strip_internal_fields(object) do
object
- |> Map.drop([
- "likes",
- "like_count",
- "announcements",
- "announcement_count",
- "emoji",
- "context_id",
- "deleted_activity_id"
- ])
+ |> Map.drop(Pleroma.Constants.object_internal_fields())
end
defp strip_internal_tags(%{"tag" => tags} = object) do
end
defp strip_internal_tags(%{"tag" => tags} = object) do
@@
-1051,7
+1044,7
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
already_ap <- User.ap_enabled?(user),
{:ok, user} <- upgrade_user(user, data) do
if not already_ap do
already_ap <- User.ap_enabled?(user),
{:ok, user} <- upgrade_user(user, data) do
if not already_ap do
-
PleromaJobQueue.enqueue(:transmogrifier, __MODULE__, [:user_upgrade, user]
)
+
TransmogrifierWorker.enqueue("user_upgrade", %{"user_id" => user.id}
)
end
{:ok, user}
end
{:ok, user}
@@
-1063,7
+1056,7
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
defp upgrade_user(user, data) do
user
defp upgrade_user(user, data) do
user
- |> User.upgrade_changeset(data)
+ |> User.upgrade_changeset(data
, true
)
|> User.update_and_set_cache()
end
|> User.update_and_set_cache()
end