Merge branch 'fix/tusky-dm' into 'develop'

Add actor to recipients list

Closes #390

See merge request pleroma/pleroma!683
This commit is contained in:
kaniini 2019-01-25 05:19:32 +00:00
commit 4c99b6d35a
9 changed files with 79 additions and 52 deletions

View file

@ -158,7 +158,9 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
mentions = opts[:mentioned] || []
attentions =
activity.recipients
[]
|> Utils.maybe_notify_to_recipients(activity)
|> Utils.maybe_notify_mentioned_recipients(activity)
|> Enum.map(fn ap_id -> Enum.find(mentions, fn user -> ap_id == user.ap_id end) end)
|> Enum.filter(& &1)
|> Enum.map(fn user -> UserView.render("show.json", %{user: user, for: opts[:for]}) end)

View file

@ -236,7 +236,9 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
pinned = activity.id in user.info.pinned_activities
attentions =
activity.recipients
[]
|> Utils.maybe_notify_to_recipients(activity)
|> Utils.maybe_notify_mentioned_recipients(activity)
|> Enum.map(fn ap_id -> get_user(ap_id, opts) end)
|> Enum.filter(& &1)
|> Enum.map(fn user -> UserView.render("show.json", %{user: user, for: opts[:for]}) end)