twitter_api/remote_follow: allow leading @ in nicknames
All checks were successful
ci/woodpecker/pr/test/2 Pipeline was successful
ci/woodpecker/pr/test/1 Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/publish/4 Pipeline was successful
ci/woodpecker/push/publish/1 Pipeline was successful
ci/woodpecker/push/publish/2 Pipeline was successful
All checks were successful
ci/woodpecker/pr/test/2 Pipeline was successful
ci/woodpecker/pr/test/1 Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/publish/4 Pipeline was successful
ci/woodpecker/push/publish/1 Pipeline was successful
ci/woodpecker/push/publish/2 Pipeline was successful
And never attempt to fetch nicknames as URLs
This commit is contained in:
parent
5873e40484
commit
7b9a0e6d71
1 changed files with 10 additions and 3 deletions
|
|
@ -29,9 +29,16 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowController do
|
|||
# GET /ostatus_subscribe
|
||||
#
|
||||
def follow(%{assigns: %{user: user}} = conn, %{"acct" => acct}) do
|
||||
case is_status?(acct) do
|
||||
true -> follow_status(conn, user, acct)
|
||||
_ -> follow_account(conn, user, acct)
|
||||
cond do
|
||||
String.starts_with?(acct, "@") ->
|
||||
follow_account(conn, user, String.slice(acct, 1..-1//1))
|
||||
|
||||
String.starts_with?(acct, "http://") ||
|
||||
(String.starts_with?(acct, "https://") && is_status?(acct)) ->
|
||||
follow_status(conn, user, acct)
|
||||
|
||||
true ->
|
||||
follow_account(conn, user, acct)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue