From 7b9a0e6d71dfd0ce5279645be702df230526ac28 Mon Sep 17 00:00:00 2001 From: Oneric Date: Mon, 2 Mar 2026 00:00:00 +0000 Subject: [PATCH] twitter_api/remote_follow: allow leading @ in nicknames And never attempt to fetch nicknames as URLs --- .../controllers/remote_follow_controller.ex | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/twitter_api/controllers/remote_follow_controller.ex b/lib/pleroma/web/twitter_api/controllers/remote_follow_controller.ex index 1927d2021..20efa82bf 100644 --- a/lib/pleroma/web/twitter_api/controllers/remote_follow_controller.ex +++ b/lib/pleroma/web/twitter_api/controllers/remote_follow_controller.ex @@ -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