From 1089d3658e30dc9beabd3d6985712ab3837fe41a Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Mon, 6 Aug 2018 11:20:41 +0000 Subject: [PATCH] user: fix up notification last calculation [NOT related to upstream] --- lib/pleroma/user.ex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 88293a4f3..6f8e39f74 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -467,10 +467,15 @@ def get_notified_from_activity_query(to) do def get_notified_from_activity(%Activity{recipients: to, data: %{"type" => "Announce"} = data}) do object = Object.normalize(data["object"]) + actor = User.get_cached_by_ap_id(data["actor"]) # ensure that the actor who published the announced object appears only once to = - (to ++ [object.data["actor"]]) + if actor.nickname != nil do + (to ++ [object.data["actor"]]) + else + to + end |> Enum.uniq() query = get_notified_from_activity_query(to)