Merge branch 'fix-remote-follow-from-ostatus-subscribe' into 'develop'
Fix remote follow from /ostatus_subscribe Closes #1103 See merge request pleroma/pleroma!1472
This commit is contained in:
commit
19835be067
5 changed files with 43 additions and 6 deletions
|
|
@ -17,7 +17,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
|||
alias Pleroma.Web
|
||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
alias Pleroma.Web.CommonAPI
|
||||
alias Pleroma.Web.OStatus
|
||||
alias Pleroma.Web.WebFinger
|
||||
|
||||
def help_test(conn, _params) do
|
||||
|
|
@ -60,7 +59,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
|||
%Activity{id: activity_id} = Activity.get_create_by_object_ap_id(object.data["id"])
|
||||
redirect(conn, to: "/notice/#{activity_id}")
|
||||
else
|
||||
{err, followee} = OStatus.find_or_make_user(acct)
|
||||
{err, followee} = User.get_or_fetch(acct)
|
||||
avatar = User.avatar_url(followee)
|
||||
name = followee.nickname
|
||||
id = followee.id
|
||||
|
|
|
|||
|
|
@ -86,11 +86,17 @@ defmodule Pleroma.Web.WebFinger do
|
|||
|> XmlBuilder.to_doc()
|
||||
end
|
||||
|
||||
defp get_magic_key(magic_key) do
|
||||
"data:application/magic-public-key," <> magic_key = magic_key
|
||||
defp get_magic_key("data:application/magic-public-key," <> magic_key) do
|
||||
{:ok, magic_key}
|
||||
rescue
|
||||
MatchError -> {:error, "Missing magic key data."}
|
||||
end
|
||||
|
||||
defp get_magic_key(nil) do
|
||||
Logger.debug("Undefined magic key.")
|
||||
{:ok, nil}
|
||||
end
|
||||
|
||||
defp get_magic_key(_) do
|
||||
{:error, "Missing magic key data."}
|
||||
end
|
||||
|
||||
defp webfinger_from_xml(doc) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue