aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-05-30 14:26:31 +0200
committerRoger Braun <roger@rogerbraun.net>2017-05-30 14:26:31 +0200
commitc6aa60c829abb7eeff3e0aec0b8b5eb33b8a4947 (patch)
tree669f4e495af8f18ae852818a9a590c76aba49cca /lib
parentfb787731122477c80dab6ab0ca9e3fdcc3461ea2 (diff)
downloadpleroma-c6aa60c829abb7eeff3e0aec0b8b5eb33b8a4947.tar.gz
Shorten names in links.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/twitter_api/utils.ex3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/twitter_api/utils.ex b/lib/pleroma/web/twitter_api/utils.ex
index 82e3620f2..91dfa191f 100644
--- a/lib/pleroma/web/twitter_api/utils.ex
+++ b/lib/pleroma/web/twitter_api/utils.ex
@@ -38,7 +38,8 @@ defmodule Pleroma.Web.TwitterAPI.Utils do
end)
Enum.reduce(mentions, step_one, fn ({match, %User{ap_id: ap_id}, uuid}, text) ->
- String.replace(text, uuid, "<a href='#{ap_id}'>#{match}</a>")
+ short_match = String.split(match, "@") |> tl() |> hd()
+ String.replace(text, uuid, "<a href='#{ap_id}'>@#{short_match}</a>")
end)
end