From 806550c921d1137e47ec662ea83ee0a542fb55d5 Mon Sep 17 00:00:00 2001 From: lain Date: Tue, 3 Apr 2018 18:32:46 +0200 Subject: Use user url in mention if we have it. --- lib/pleroma/formatter.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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, "@#{short_match}"} end) -- cgit v1.2.3