summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api/utils.ex
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-08-29 18:48:53 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-08-29 18:48:53 +0000
commit0b2119d4a791b3623b304b0bab683609d23271d4 (patch)
tree40eac155fc0b26d924aa072fd289fc3e64bfad26 /lib/pleroma/web/common_api/utils.ex
parentdc63aaf84f07a6f8042f43617d8ec356fed85cec (diff)
parent7372609c5b5063d177715d5067654888f7075403 (diff)
Merge branch 'release/2.4.1' into 'stable'v2.4.1
Release: 2.4.1 See merge request pleroma/pleroma!3501
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r--lib/pleroma/web/common_api/utils.ex17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index 33639e695..10eb48250 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -412,19 +412,14 @@ defmodule Pleroma.Web.CommonAPI.Utils do
def maybe_notify_mentioned_recipients(recipients, _), do: recipients
- # Do not notify subscribers if author is making a reply
- def maybe_notify_subscribers(recipients, %Activity{
- object: %Object{data: %{"inReplyTo" => _ap_id}}
- }) do
- recipients
- end
-
def maybe_notify_subscribers(
recipients,
- %Activity{data: %{"actor" => actor, "type" => type}} = activity
- )
- when type == "Create" do
- with %User{} = user <- User.get_cached_by_ap_id(actor) do
+ %Activity{data: %{"actor" => actor, "type" => "Create"}} = activity
+ ) do
+ # Do not notify subscribers if author is making a reply
+ with %Object{data: object} <- Object.normalize(activity, fetch: false),
+ nil <- object["inReplyTo"],
+ %User{} = user <- User.get_cached_by_ap_id(actor) do
subscriber_ids =
user
|> User.subscriber_users()