added force option to the unfollow operation

This commit is contained in:
Maksim Pechnikov 2020-09-28 09:16:42 +03:00
commit de993b856b
8 changed files with 160 additions and 25 deletions

View file

@ -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