From: William Pitcock Date: Mon, 6 Aug 2018 11:20:41 +0000 (+0000) Subject: user: fix up notification last calculation [NOT related to upstream] X-Git-Url: http://git.squeep.com/?a=commitdiff_plain;h=1089d3658e30dc9beabd3d6985712ab3837fe41a;p=akkoma user: fix up notification last calculation [NOT related to upstream] --- 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 @@ defmodule Pleroma.User 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)