+ Since JS cannot ask remote instances for their packs due to CPS, it has to
+ be done by the server
+ """
+ def list_from(conn, %{"instance_address" => address}) do
+ address = String.trim(address)
+
+ if shareable_packs_available(address) do
+ list_resp =
+ "#{address}/api/pleroma/emoji/packs" |> Tesla.get!() |> Map.get(:body) |> Jason.decode!()
+
+ json(conn, list_resp)
+ else
+ conn
+ |> put_status(:internal_server_error)
+ |> json(%{error: "The requested instance does not support sharing emoji packs"})
+ end
+ end