X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fmix%2Ftasks%2Fpleroma%2Frelay.ex;h=a6d8d6c1c872e35a3c5df60bd8a4a4bdc92ad7e5;hb=4ee99dafccd6f7c037270d6bac5e942f322c7efd;hp=b67d256c3278a2780564df3c8cc28562e6cb346a;hpb=72ad3a66f48d4500be1f25dd7b02b834399d3bbe;p=akkoma diff --git a/lib/mix/tasks/pleroma/relay.ex b/lib/mix/tasks/pleroma/relay.ex index b67d256c3..a6d8d6c1c 100644 --- a/lib/mix/tasks/pleroma/relay.ex +++ b/lib/mix/tasks/pleroma/relay.ex @@ -12,7 +12,6 @@ defmodule Mix.Tasks.Pleroma.Relay do def run(["follow", target]) do start_pleroma() - Application.ensure_all_started(:flake_id) with {:ok, _activity} <- Relay.follow(target) do # put this task to sleep to allow the genserver to push out the messages @@ -24,7 +23,6 @@ defmodule Mix.Tasks.Pleroma.Relay do def run(["unfollow", target]) do start_pleroma() - Application.ensure_all_started(:flake_id) with {:ok, _activity} <- Relay.unfollow(target) do # put this task to sleep to allow the genserver to push out the messages @@ -36,12 +34,17 @@ defmodule Mix.Tasks.Pleroma.Relay do def run(["list"]) do start_pleroma() - Application.ensure_all_started(:flake_id) - with {:ok, list} <- Relay.list(true) do - list |> Enum.each(&shell_info(&1)) + with {:ok, list} <- Relay.list() do + Enum.each(list, &print_relay_url/1) else {:error, e} -> shell_error("Error while fetching relay subscription list: #{inspect(e)}") end end + + defp print_relay_url(%{followed_back: false} = relay) do + shell_info("#{relay.actor} - no Accept received (relay didn't follow back)") + end + + defp print_relay_url(relay), do: shell_info(relay.actor) end