diff options
author | lain <lain@soykaf.club> | 2018-04-03 18:32:46 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-04-03 18:32:46 +0200 |
commit | 806550c921d1137e47ec662ea83ee0a542fb55d5 (patch) | |
tree | 4a5d082effc5463f26c7ec6754cbca0437d84fd0 /lib/pleroma/formatter.ex | |
parent | b3b7ab5d9a0528bdfa385bd61d7f97ae4c7de374 (diff) | |
download | pleroma-806550c921d1137e47ec662ea83ee0a542fb55d5.tar.gz |
Use user url in mention if we have it.
Diffstat (limited to 'lib/pleroma/formatter.ex')
-rw-r--r-- | lib/pleroma/formatter.ex | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index 9396b1826..3634a8f5b 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -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) |