X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fformatter.ex;h=386096a52b2ad4dfbf94ccf32685b1b734fd8ac2;hb=8a0b755c19ef9c896f69de2b1bf22418a3aedf6f;hp=9e50ea3f4a700d5a85eca17602cf5e6bf9fb87eb;hpb=74346a7035d950ede143d65f8364194cb116aaf5;p=akkoma diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index 9e50ea3f4..386096a52 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -130,7 +130,7 @@ defmodule Pleroma.Formatter do end @doc "Adds the links to mentioned users" - def add_user_links({subs, text}, mentions) do + def add_user_links({subs, text}, mentions, options \\ []) do mentions = mentions |> Enum.sort_by(fn {name, _} -> -String.length(name) end) @@ -152,12 +152,16 @@ defmodule Pleroma.Formatter do ap_id end - short_match = String.split(match, "@") |> tl() |> hd() + nickname = + if options[:format] == :full do + User.full_nickname(match) + else + User.local_nickname(match) + end {uuid, - "@#{ - short_match - }"} + "" <> + "@#{nickname}"} end) {subs, uuid_text}