summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-05-01 22:29:22 +0300
committerrinpatch <rinpatch@sdf.org>2020-05-01 22:56:18 +0300
commit2646fdea224cb2af7d2adc66265c334ae1c69669 (patch)
tree9df271ebf32c5dc9fbd5df5e602494637cfbb473
parentb6ca8cc53915b5cd86513b8c5214477626e97f3d (diff)
signature.ex: Remove the use of ObjectID type
It is not in stable yet
-rw-r--r--lib/pleroma/signature.ex13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/pleroma/signature.ex b/lib/pleroma/signature.ex
index d01728361..7006eb2c0 100644
--- a/lib/pleroma/signature.ex
+++ b/lib/pleroma/signature.ex
@@ -8,7 +8,6 @@ defmodule Pleroma.Signature do
alias Pleroma.Keys
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.Web.ActivityPub.ObjectValidators.Types
def key_id_to_actor_id(key_id) do
uri =
@@ -22,16 +21,14 @@ defmodule Pleroma.Signature do
uri
end
- maybe_ap_id = URI.to_string(uri)
-
- case Types.ObjectID.cast(maybe_ap_id) do
- {:ok, ap_id} ->
- {:ok, ap_id}
+ case uri do
+ %URI{scheme: scheme} when scheme in ["https", "http"] ->
+ {:ok, URI.to_string(uri)}
_ ->
- case Pleroma.Web.WebFinger.finger(maybe_ap_id) do
+ case Pleroma.Web.WebFinger.finger(URI.to_string(uri)) do
%{"ap_id" => ap_id} -> {:ok, ap_id}
- _ -> {:error, maybe_ap_id}
+ _ -> {:error, URI.to_string(uri)}
end
end
end