Use user url in mention if we have it.

This commit is contained in:
lain 2018-04-03 18:32:46 +02:00
commit 806550c921
2 changed files with 11 additions and 3 deletions

View file

@ -189,7 +189,9 @@ defmodule Pleroma.Formatter do
subs =
subs ++
Enum.map(mentions, fn {match, %User{ap_id: ap_id}, uuid} ->
Enum.map(mentions, fn {match, %User{ap_id: ap_id, info: info}, uuid} ->
ap_id = info["source_data"]["url"] || ap_id
short_match = String.split(match, "@") |> tl() |> hd()
{uuid, "<span><a href='#{ap_id}'>@<span>#{short_match}</span></a></span>"}
end)