diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-02-25 17:58:15 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-02-25 18:08:01 +0300 |
commit | 1c05ff7c06e281fe2abd05ff4969e30ec7268bb1 (patch) | |
tree | b7acaaa4b2689cf3c3b956e0a7efd0342bfcc8bc /lib/mix | |
parent | 42f76306e7fe69fc51be00285a4fef8569f54989 (diff) | |
download | pleroma-relay-list-change-for-stable.tar.gz |
relay list shows hosts without accepted followrelay-list-change-for-stable
Diffstat (limited to 'lib/mix')
-rw-r--r-- | lib/mix/tasks/pleroma/relay.ex | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/mix/tasks/pleroma/relay.ex b/lib/mix/tasks/pleroma/relay.ex index a738fae75..0df6b53ff 100644 --- a/lib/mix/tasks/pleroma/relay.ex +++ b/lib/mix/tasks/pleroma/relay.ex @@ -53,10 +53,19 @@ defmodule Mix.Tasks.Pleroma.Relay do def run(["list"]) do start_pleroma() - with %User{following: following} = _user <- Relay.get_actor() do - following - |> Enum.map(fn entry -> URI.parse(entry).host end) - |> Enum.uniq() + with %User{following: following} = user <- Relay.get_actor() do + accepted = + following + |> Enum.map(fn entry -> URI.parse(entry).host end) + |> Enum.uniq() + + without_accept = + user + |> Pleroma.Activity.following_requests_for_actor() + |> Enum.map(fn a -> URI.parse(a.data["object"]).host <> " (no Accept received)" end) + |> Enum.uniq() + + (accepted ++ without_accept) |> Enum.each(&shell_info(&1)) else e -> shell_error("Error while fetching relay subscription list: #{inspect(e)}") |