fetch url for OStatus to know if it is a/c or status

This commit is contained in:
Sachin Joshi 2019-04-02 10:26:09 +05:45
commit 6386c1c9c1
6 changed files with 377 additions and 108 deletions

View file

@ -103,8 +103,10 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
end
defp is_status?(acct) do
%URI{path: path} = URI.parse(acct)
Regex.match?(~r/\/users\/[^\/]+\/statuses\/([0-9]+)$/, path)
case ActivityPub.fetch_and_contain_remote_object_from_id(acct) do
{:ok, %{"type" => "Note"}} -> true
_ -> false
end
end
def do_remote_follow(conn, %{