aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/twitter_api/utils.ex
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-06-01 11:24:03 +0200
committerRoger Braun <roger@rogerbraun.net>2017-06-01 11:24:03 +0200
commitc7fdd1b7ff6e7a08389395d555862eaec9721b08 (patch)
tree2eacd5f670c35fa834399636a0cc5c8de53ba054 /lib/pleroma/web/twitter_api/utils.ex
parent87c2c42badd7d8cd1f36e979eae923725f27bbe7 (diff)
parent4cfe1e0c9becebbc5665eb28b187451f96c73555 (diff)
downloadpleroma-c7fdd1b7ff6e7a08389395d555862eaec9721b08.tar.gz
Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into develop
Diffstat (limited to 'lib/pleroma/web/twitter_api/utils.ex')
-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 32b9eab44..65d893869 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