Merge branch 'refactor-add-mention-step-one' into 'develop'
Fix ObjectView calling into strange functions Closes #1807 See merge request pleroma/pleroma!2580
This commit is contained in:
commit
d35be02e70
5 changed files with 32 additions and 21 deletions
|
|
@ -1045,10 +1045,14 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
Map.put(object, "tag", tags)
|
||||
end
|
||||
|
||||
# TODO These should be added on our side on insertion, it doesn't make much
|
||||
# sense to regenerate these all the time
|
||||
def add_mention_tags(object) do
|
||||
{enabled_receivers, disabled_receivers} = Utils.get_notified_from_object(object)
|
||||
potential_receivers = enabled_receivers ++ disabled_receivers
|
||||
mentions = Enum.map(potential_receivers, &build_mention_tag/1)
|
||||
to = object["to"] || []
|
||||
cc = object["cc"] || []
|
||||
mentioned = User.get_users_from_set(to ++ cc, local_only: false)
|
||||
|
||||
mentions = Enum.map(mentioned, &build_mention_tag/1)
|
||||
|
||||
tags = object["tag"] || []
|
||||
Map.put(object, "tag", tags ++ mentions)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue