user: only consider to recipients as mention targets

This commit is contained in:
William Pitcock 2018-11-08 18:55:50 +00:00
parent a44d87f059
commit 144dc048b8

View file

@ -472,7 +472,7 @@ def get_notified_from_activity_query(to) 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 @@ def get_notified_from_activity(%Activity{recipients: to, data: %{"type" => "Anno
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(