projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ActivityPub: Partly handle incoming follows.
[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 b6a2d6c5e9de1293891d01f3fbff039086e2baa9..8e15fde4a810cf1373b92e255ceb271c1ee3103e 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub.ex
@@
-1,5
+1,6
@@
defmodule Pleroma.Web.ActivityPub.ActivityPub do
alias Pleroma.{Activity, Repo, Object, Upload, User, Notification}
defmodule Pleroma.Web.ActivityPub.ActivityPub do
alias Pleroma.{Activity, Repo, Object, Upload, User, Notification}
+ alias Pleroma.Web.ActivityPub.Transmogrifier
import Ecto.Query
import Pleroma.Web.ActivityPub.Utils
require Logger
import Ecto.Query
import Pleroma.Web.ActivityPub.Utils
require Logger
@@
-242,15
+243,9
@@
defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
end
end
end
- # TODO: Extract to own module, align as close to Mastodon format as possible.
- def sanitize_outgoing_activity_data(data) do
- data
- |> Map.put("@context", "https://www.w3.org/ns/activitystreams")
- end
-
def publish(actor, activity) do
remote_users = Pleroma.Web.Salmon.remote_users(activity)
def publish(actor, activity) do
remote_users = Pleroma.Web.Salmon.remote_users(activity)
-
data = sanitize_outgoing_activity_data
(activity.data)
+
{:ok, data} = Transmogrifier.prepare_outgoing
(activity.data)
Enum.each remote_users, fn(user) ->
if user.info["ap_enabled"] do
inbox = user.info["source_data"]["inbox"]
Enum.each remote_users, fn(user) ->
if user.info["ap_enabled"] do
inbox = user.info["source_data"]["inbox"]