user: only consider `to` recipients as mention targets
authorWilliam Pitcock <nenolod@dereferenced.org>
Thu, 8 Nov 2018 18:55:50 +0000 (18:55 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Thu, 8 Nov 2018 18:58:24 +0000 (18:58 +0000)
lib/pleroma/user.ex

index b2f59ab6b61abc7a55df3fdd533a52c317635d85..0d11101a32bb24c863851a660d7f8731bab17814 100644 (file)
@@ -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(