diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-05-02 07:39:19 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-05-02 07:39:19 +0300 |
commit | cf5ca7e45b7a5df18717c8b6ea0afa045e341f65 (patch) | |
tree | c586802831c88e484e770a8f62b402fa573485e3 /lib/pleroma/web/common_api/common_api.ex | |
parent | 92efb888c7b25692af205b1a4dbce0ae689c439b (diff) | |
parent | ae921a0c24b9b1dcdea408decc691d66a538b6b8 (diff) | |
download | pleroma-cf5ca7e45b7a5df18717c8b6ea0afa045e341f65.tar.gz |
Merge remote-tracking branch 'remotes/origin/develop' into follow-request-notifications
Diffstat (limited to 'lib/pleroma/web/common_api/common_api.ex')
-rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 4112e441a..4618b4bbf 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -382,9 +382,9 @@ defmodule Pleroma.Web.CommonAPI do ThreadMute.exists?(user.id, activity.data["context"]) end - def report(user, %{"account_id" => account_id} = data) do - with {:ok, account} <- get_reported_account(account_id), - {:ok, {content_html, _, _}} <- make_report_content_html(data["comment"]), + def report(user, data) do + with {:ok, account} <- get_reported_account(data.account_id), + {:ok, {content_html, _, _}} <- make_report_content_html(data[:comment]), {:ok, statuses} <- get_report_statuses(account, data) do ActivityPub.flag(%{ context: Utils.generate_context_id(), @@ -392,13 +392,11 @@ defmodule Pleroma.Web.CommonAPI do account: account, statuses: statuses, content: content_html, - forward: data["forward"] || false + forward: Map.get(data, :forward, false) }) end end - def report(_user, _params), do: {:error, dgettext("errors", "Valid `account_id` required")} - defp get_reported_account(account_id) do case User.get_cached_by_id(account_id) do %User{} = account -> {:ok, account} |