projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ActivityPubController: Add Mastodon compatibility route.
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
activity_pub_controller.ex
diff --git
a/lib/pleroma/web/activity_pub/activity_pub_controller.ex
b/lib/pleroma/web/activity_pub/activity_pub_controller.ex
index 976ff243ea0b6558009e772ed2acd07aed1538f9..5a41dac5c70f885704057d815f94c4b1789c6a32 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub_controller.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub_controller.ex
@@
-21,6
+21,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
alias Pleroma.Web.ActivityPub.UserView
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.ActivityPub.Visibility
alias Pleroma.Web.ActivityPub.UserView
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.ActivityPub.Visibility
+ alias Pleroma.Web.Endpoint
alias Pleroma.Web.FederatingPlug
alias Pleroma.Web.Federator
alias Pleroma.Web.FederatingPlug
alias Pleroma.Web.Federator
@@
-75,8
+76,8
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
end
end
end
end
- def object(conn,
%{"uuid" => uuid}
) do
- with ap_id <-
o_status_url(conn, :object, uuid)
,
+ def object(conn,
_
) do
+ with ap_id <-
Endpoint.url() <> conn.request_path
,
%Object{} = object <- Object.get_cached_by_ap_id(ap_id),
{_, true} <- {:public?, Visibility.is_public?(object)} do
conn
%Object{} = object <- Object.get_cached_by_ap_id(ap_id),
{_, true} <- {:public?, Visibility.is_public?(object)} do
conn
@@
-396,7
+397,10
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
|> json(err)
end
|> json(err)
end
- defp handle_user_activity(%User{} = user, %{"type" => "Create"} = params) do
+ defp handle_user_activity(
+ %User{} = user,
+ %{"type" => "Create", "object" => %{"type" => "Note"}} = params
+ ) do
object =
params["object"]
|> Map.merge(Map.take(params, ["to", "cc"]))
object =
params["object"]
|> Map.merge(Map.take(params, ["to", "cc"]))