Merge branch 'feature/cli-reload-emoji' into 'develop'
[akkoma] / lib / pleroma / web / common_api / common_api.ex
index 764fa4f4fbfd4c0d21260c4a8c4a8752ed2384cd..5a194910dbaa0ea9839fe2487c07a1bc6518d8ca 100644 (file)
@@ -50,7 +50,15 @@ 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()
+      |> (fn {text, mentions, tags} ->
+            {String.replace(text, ~r/\r?\n/, "<br>"), mentions, tags}
+          end).()
+
+    text
   end
 
   defp validate_chat_content_length(_, true), do: :ok
@@ -113,6 +121,7 @@ defmodule Pleroma.Web.CommonAPI do
              object: follow_activity.data["id"],
              type: "Accept"
            }) do
+      Notification.update_notification_type(followed, follow_activity)
       {:ok, follower}
     end
   end