diff options
author | lain <lain@soykaf.club> | 2020-07-03 16:44:31 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-07-03 16:44:31 +0200 |
commit | d3efb50262e7922fc1aa80625679a7e29bb65836 (patch) | |
tree | 1b9c37c851739b041462a5bf50864a4c5d24ffd8 /lib/pleroma/web/common_api | |
parent | 244655e884130df6dccabc0d2d78d33857809a36 (diff) | |
parent | 19fbfbb767169b58a8f6558d0ad1a9be6425b59d (diff) | |
download | pleroma-d3efb50262e7922fc1aa80625679a7e29bb65836.tar.gz |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into features/mastoapi-2.9.0-status_text
Diffstat (limited to 'lib/pleroma/web/common_api')
-rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 04e081a8e..fd7149079 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -25,6 +25,13 @@ defmodule Pleroma.Web.CommonAPI do require Pleroma.Constants require Logger + def block(blocker, blocked) do + with {:ok, block_data, _} <- Builder.block(blocker, blocked), + {:ok, block, _} <- Pipeline.common_pipeline(block_data, local: true) do + {:ok, block} + end + end + def post_chat_message(%User{} = user, %User{} = recipient, content, opts \\ []) do with maybe_attachment <- opts[:media_id] && Object.get_by_id(opts[:media_id]), :ok <- validate_chat_content_length(content, !!maybe_attachment), |