diff options
author | lain <lain@soykaf.club> | 2020-10-12 15:03:08 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-10-12 15:03:08 +0200 |
commit | 346a59aee68d71af5d7ab6cfb9ff89008a032f2b (patch) | |
tree | a3b47a0fdba667cef77a6a65c5551d02c051ba08 /lib/pleroma/web/admin_api/controllers/relay_controller.ex | |
parent | c13c924ccb877d91068982f3a0ca9690c948a29c (diff) | |
parent | bc3cf0fee0b93eb3cf8d2ba0f9a0dcc09b01331d (diff) | |
download | pleroma-346a59aee68d71af5d7ab6cfb9ff89008a032f2b.tar.gz |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into 2061-chat-deletion
Diffstat (limited to 'lib/pleroma/web/admin_api/controllers/relay_controller.ex')
-rw-r--r-- | lib/pleroma/web/admin_api/controllers/relay_controller.ex | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/pleroma/web/admin_api/controllers/relay_controller.ex b/lib/pleroma/web/admin_api/controllers/relay_controller.ex index 95d06dde7..6c19f09f7 100644 --- a/lib/pleroma/web/admin_api/controllers/relay_controller.ex +++ b/lib/pleroma/web/admin_api/controllers/relay_controller.ex @@ -33,11 +33,7 @@ defmodule Pleroma.Web.AdminAPI.RelayController do def follow(%{assigns: %{user: admin}, body_params: %{relay_url: target}} = conn, _) do with {:ok, _message} <- Relay.follow(target) do - ModerationLog.insert_log(%{ - action: "relay_follow", - actor: admin, - target: target - }) + ModerationLog.insert_log(%{action: "relay_follow", actor: admin, target: target}) json(conn, %{actor: target, followed_back: target in Relay.following()}) else @@ -48,13 +44,9 @@ defmodule Pleroma.Web.AdminAPI.RelayController do end end - def unfollow(%{assigns: %{user: admin}, body_params: %{relay_url: target}} = conn, _) do - with {:ok, _message} <- Relay.unfollow(target) do - ModerationLog.insert_log(%{ - action: "relay_unfollow", - actor: admin, - target: target - }) + def unfollow(%{assigns: %{user: admin}, body_params: %{relay_url: target} = params} = conn, _) do + with {:ok, _message} <- Relay.unfollow(target, %{force: params[:force]}) do + ModerationLog.insert_log(%{action: "relay_unfollow", actor: admin, target: target}) json(conn, target) else |