From: William Pitcock Date: Thu, 8 Nov 2018 18:55:50 +0000 (+0000) Subject: user: only consider `to` recipients as mention targets X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=144dc048b8c5f71b41f9f14b6cc4315de4dca707;p=akkoma user: only consider `to` recipients as mention targets --- diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index b2f59ab6b..0d11101a3 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -472,7 +472,7 @@ defmodule Pleroma.User do ) end - def get_notified_from_activity(%Activity{recipients: to, data: %{"type" => "Announce"} = data}) do + def get_notified_from_activity(%Activity{data: %{"type" => "Announce", "to" => to} = data}) do object = Object.normalize(data["object"]) actor = User.get_cached_by_ap_id(data["actor"]) @@ -490,12 +490,14 @@ defmodule Pleroma.User do Repo.all(query) end - def get_notified_from_activity(%Activity{recipients: to}) do + def get_notified_from_activity(%Activity{data: %{"to" => to}}) do query = get_notified_from_activity_query(to) Repo.all(query) end + def get_notified_from_activity(_), do: [] + def get_recipients_from_activity(%Activity{recipients: to}) do query = from(