diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-06-26 17:41:00 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-06-26 17:41:00 +0000 |
commit | bf1c5e255ae0ab297aac3094d6a899c24c29fd2f (patch) | |
tree | b61c301b4daa6bcb9633dedf09f687d69cf6edf1 /lib/pleroma/web/common_api | |
parent | 09478c9cf713eefdfdf585f0196efdf00b9c0baf (diff) | |
parent | 15a8b703185c685fc3d25a381fcb9dee522c78bf (diff) | |
download | pleroma-bf1c5e255ae0ab297aac3094d6a899c24c29fd2f.tar.gz |
Merge branch 'block-handling' into 'develop'
Handle blocks with the pipeline
See merge request pleroma/pleroma!2685
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), |