diff options
author | lain <lain@soykaf.club> | 2020-05-30 12:30:31 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-30 12:30:31 +0200 |
commit | 8bdf18d7c10f0e740b2f5e0fa5063c522b8b3872 (patch) | |
tree | 4d33c221c91a6df4d451ebaa0291319959806f73 /lib | |
parent | 2c9465cc51160546ae054d1a1912fbb8e9add8e8 (diff) | |
download | pleroma-8bdf18d7c10f0e740b2f5e0fa5063c522b8b3872.tar.gz |
CommonAPI: Linkify chat messages.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 764fa4f4f..173353aa5 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -50,7 +50,12 @@ defmodule Pleroma.Web.CommonAPI do defp format_chat_content(nil), do: nil defp format_chat_content(content) do - content |> Formatter.html_escape("text/plain") + {text, _, _} = + content + |> Formatter.html_escape("text/plain") + |> Formatter.linkify() + + text end defp validate_chat_content_length(_, true), do: :ok |