2018-08-06 00:14:16 -07:00
|
|
|
defmodule Mix.Tasks.RelayUnfollow do
|
|
|
|
use Mix.Task
|
|
|
|
require Logger
|
|
|
|
alias Pleroma.Web.ActivityPub.Relay
|
|
|
|
|
2018-11-08 06:21:09 -08:00
|
|
|
@doc """
|
|
|
|
Unfollows a remote relay
|
|
|
|
|
|
|
|
Usage: ``mix relay_follow <relay_url>``
|
|
|
|
|
|
|
|
Example: ``mix relay_follow https://example.org/relay``
|
|
|
|
"""
|
2018-08-06 00:14:16 -07:00
|
|
|
def run([target]) do
|
|
|
|
Mix.Task.run("app.start")
|
|
|
|
|
|
|
|
:ok = Relay.unfollow(target)
|
2018-08-06 00:27:11 -07:00
|
|
|
|
|
|
|
# put this task to sleep to allow the genserver to push out the messages
|
|
|
|
:timer.sleep(500)
|
2018-08-06 00:14:16 -07:00
|
|
|
end
|
|
|
|
end
|