diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-09-28 09:16:42 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-09-28 09:16:42 +0300 |
commit | de993b856bc2145e7c4aaa47767c7edc826798c7 (patch) | |
tree | 85657fa50346fe78059a38e89951a96c392abada /lib/mix/tasks | |
parent | 35157f5dc845483e9d65236b87461f15c77ad634 (diff) | |
download | pleroma-de993b856bc2145e7c4aaa47767c7edc826798c7.tar.gz |
added `force` option to the unfollow operation
Diffstat (limited to 'lib/mix/tasks')
-rw-r--r-- | lib/mix/tasks/pleroma/relay.ex | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/mix/tasks/pleroma/relay.ex b/lib/mix/tasks/pleroma/relay.ex index a6d8d6c1c..bb808ca47 100644 --- a/lib/mix/tasks/pleroma/relay.ex +++ b/lib/mix/tasks/pleroma/relay.ex @@ -21,10 +21,19 @@ defmodule Mix.Tasks.Pleroma.Relay do end end - def run(["unfollow", target]) do + def run(["unfollow", target | rest]) do start_pleroma() - with {:ok, _activity} <- Relay.unfollow(target) do + {options, [], []} = + OptionParser.parse( + rest, + strict: [force: :boolean], + aliases: [f: :force] + ) + + force = Keyword.get(options, :force, false) + + with {:ok, _activity} <- Relay.unfollow(target, %{force: force}) do # put this task to sleep to allow the genserver to push out the messages :timer.sleep(500) else |