X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Ftwitter_api%2Fcontrollers%2Futil_controller.ex;h=ccbef6d9f11a85c80b04b9d180c334f526a01d6b;hb=9775955974171c19e2dd9e6930e96e33f25cb4db;hp=a4e44efddf3b9ef439edf4c85a9ee056939ffc72;hpb=e1b89fe3aa2c03576a6f2418c1e83c0ed64707a3;p=akkoma diff --git a/lib/pleroma/web/twitter_api/controllers/util_controller.ex b/lib/pleroma/web/twitter_api/controllers/util_controller.ex index a4e44efdd..ccbef6d9f 100644 --- a/lib/pleroma/web/twitter_api/controllers/util_controller.ex +++ b/lib/pleroma/web/twitter_api/controllers/util_controller.ex @@ -62,6 +62,15 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do end end + def remote_interaction(%{body_params: %{ap_id: ap_id, profile: profile}} = conn, _params) do + with {:ok, %{"subscribe_address" => template}} <- WebFinger.finger(profile) do + conn + |> json(%{url: String.replace(template, "{uri}", ap_id)}) + else + _e -> json(conn, %{error: "Couldn't find user"}) + end + end + def frontend_configurations(conn, _params) do render(conn, "frontend_configurations.json") end