X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fformatter.ex;h=386096a52b2ad4dfbf94ccf32685b1b734fd8ac2;hb=c9b418e5477229017b3750c55cf3ea3d03b7e609;hp=2696f41c00fa653f94559f198b84280f7b9872bf;hpb=997f4a5e09f8531f95ba3f13986b9dda583d046a;p=akkoma
diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex
index 2696f41c0..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,10 +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}
@@ -178,7 +184,7 @@ defmodule Pleroma.Formatter do
subs ++
Enum.map(tags, fn {tag_text, tag, uuid} ->
url =
- "#{
+ "#{
tag_text
}"