ostatus: we need to include the original author of a message as a mention
authorWilliam Pitcock <nenolod@dereferenced.org>
Mon, 18 Jun 2018 05:11:05 +0000 (05:11 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Mon, 18 Jun 2018 05:27:09 +0000 (05:27 +0000)
this is due to the use of activity.recipients which may not necessarily contain the original
author if the actors are not following each other.

lib/pleroma/web/ostatus/activity_representer.ex

index 4179d86c9b354adb1501c5de6d3cae3a6a805183..4c4a0c233d9268523fed480d5945f9829a3d2d72 100644 (file)
@@ -184,7 +184,10 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
 
     retweeted_xml = to_simple_form(retweeted_activity, retweeted_user, true)
 
-    mentions = activity.recipients |> get_mentions
+    mentions =
+      ([retweeted_user.ap_id] ++ activity.recipients)
+      |> Enum.uniq()
+      |> get_mentions()
 
     [
       {:"activity:object-type", ['http://activitystrea.ms/schema/1.0/activity']},