CommonAPI: Newlines -> br for chat messages.

This commit is contained in:
lain 2020-06-01 15:14:22 +02:00
commit af9090238e
2 changed files with 23 additions and 0 deletions

View file

@ -50,6 +50,26 @@ defmodule Pleroma.Web.CommonAPITest do
assert activity
end
test "it adds html newlines" do
author = insert(:user)
recipient = insert(:user)
other_user = insert(:user)
{:ok, activity} =
CommonAPI.post_chat_message(
author,
recipient,
"uguu\nuguuu"
)
assert other_user.ap_id not in activity.recipients
object = Object.normalize(activity, false)
assert object.data["content"] == "uguu<br/>uguuu"
end
test "it linkifies" do
author = insert(:user)
recipient = insert(:user)