aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-08-19 13:31:56 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-08-19 13:39:18 +0300
commite652cef76b99588867315347e8dcc3d323d8a161 (patch)
treebc80d512044cec52ec10039ae3486a37d8fc17af /lib
parent3315a2a1c3cae3375bbb1c7112b2c75563f3a4af (diff)
downloadpleroma-e652cef76b99588867315347e8dcc3d323d8a161.tar.gz
removes duplicates from relay subscription list
Diffstat (limited to 'lib')
-rw-r--r--lib/mix/tasks/pleroma/relay.ex12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/mix/tasks/pleroma/relay.ex b/lib/mix/tasks/pleroma/relay.ex
index c7324fff6..a738fae75 100644
--- a/lib/mix/tasks/pleroma/relay.ex
+++ b/lib/mix/tasks/pleroma/relay.ex
@@ -53,13 +53,11 @@ defmodule Mix.Tasks.Pleroma.Relay do
def run(["list"]) do
start_pleroma()
- with %User{} = user <- Relay.get_actor() do
- user.following
- |> Enum.each(fn entry ->
- URI.parse(entry)
- |> Map.get(:host)
- |> shell_info()
- end)
+ with %User{following: following} = _user <- Relay.get_actor() do
+ following
+ |> Enum.map(fn entry -> URI.parse(entry).host end)
+ |> Enum.uniq()
+ |> Enum.each(&shell_info(&1))
else
e -> shell_error("Error while fetching relay subscription list: #{inspect(e)}")
end