summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-01-27 15:47:07 -0500
committerMark Felder <feld@feld.me>2024-01-27 15:47:07 -0500
commit17f4251b19846401ca36ee31156294ec63de84ee (patch)
tree7a0fcb5e6a3ab7d0ae6ceef4eabd1f56ab1a099c
parent8b02c858102232700826214ffb5d58e5b2f90edf (diff)
downloadpleroma-17f4251b19846401ca36ee31156294ec63de84ee.tar.gz
pleroma-17f4251b19846401ca36ee31156294ec63de84ee.zip
Pleroma.Web.TwitterAPI.UtilController: dialyzer fixes
lib/pleroma/web/twitter_api/controllers/util_controller.ex:158:call The function call will not succeed. Phoenix.Controller.json(_conn :: %{:body_params => %{:ap_id => _, :profile => _, _ => _}, _ => _}, %{ :error => <<67, 111, 117, 108, 100, 110, 39, 116, 32, 102, 105, 110, 100, 32, 117, 115, 101, 114>> }) breaks the contract (Plug.Conn.t(), term()) :: Plug.Conn.t()
-rw-r--r--lib/pleroma/web/api_spec/operations/twitter_util_operation.ex6
-rw-r--r--lib/pleroma/web/twitter_api/controllers/util_controller.ex5
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex b/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex
index 87af0d526..b536bb6c1 100644
--- a/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex
@@ -404,10 +404,10 @@ defmodule Pleroma.Web.ApiSpec.TwitterUtilOperation do
title: "RemoteInteractionRequest",
description: "POST body for remote interaction",
type: :object,
- required: [:ap_id, :profile],
+ required: ["ap_id", "profile"],
properties: %{
- ap_id: %Schema{type: :string, description: "Profile or status ActivityPub ID"},
- profile: %Schema{type: :string, description: "Remote profile webfinger"}
+ "ap_id" => %Schema{type: :string, description: "Profile or status ActivityPub ID"},
+ "profile" => %Schema{type: :string, description: "Remote profile webfinger"}
}
}
end
diff --git a/lib/pleroma/web/twitter_api/controllers/util_controller.ex b/lib/pleroma/web/twitter_api/controllers/util_controller.ex
index c8ecf5eff..a74c806a6 100644
--- a/lib/pleroma/web/twitter_api/controllers/util_controller.ex
+++ b/lib/pleroma/web/twitter_api/controllers/util_controller.ex
@@ -150,7 +150,10 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
end
end
- def remote_interaction(%{body_params: %{ap_id: ap_id, profile: profile}} = conn, _params) do
+ 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)})