From: rinpatch Date: Fri, 13 Aug 2021 12:09:39 +0000 (+0000) Subject: Merge branch 'bugfix/status-search-fallback' into 'develop' X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=7afabe1cc696fbe7e9a6350145c1bda8b39012e7;hp=6455b967ec6cf2006e02486251f65e32137b54d4;p=akkoma Merge branch 'bugfix/status-search-fallback' into 'develop' Activity.Search: resolve status on DB Timeout Closes #2566 See merge request pleroma/pleroma!3507 --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 421b6e043..231cac990 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added ### Fixed +- Subscription(Bell) Notifications: Don't create from Pipeline Ingested replies ### Removed diff --git a/lib/pleroma/web/admin_api/report.ex b/lib/pleroma/web/admin_api/report.ex index 259068f04..345bc1e87 100644 --- a/lib/pleroma/web/admin_api/report.ex +++ b/lib/pleroma/web/admin_api/report.ex @@ -13,7 +13,9 @@ defmodule Pleroma.Web.AdminAPI.Report do account = User.get_cached_by_ap_id(account_ap_id) statuses = - Enum.map(status_ap_ids, fn + status_ap_ids + |> Enum.reject(&is_nil(&1)) + |> Enum.map(fn act when is_map(act) -> Activity.get_by_ap_id_with_object(act["id"]) act when is_binary(act) -> Activity.get_by_ap_id_with_object(act) end) 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()