activity_draft: Add source field
This commit is contained in:
parent
d6c958b4c2
commit
27c33f216a
@ -186,6 +186,7 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
|
|||||||
draft.poll
|
draft.poll
|
||||||
)
|
)
|
||||||
|> Map.put("emoji", emoji)
|
|> Map.put("emoji", emoji)
|
||||||
|
|> Map.put("source", draft.status)
|
||||||
|
|
||||||
%__MODULE__{draft | object: object}
|
%__MODULE__{draft | object: object}
|
||||||
end
|
end
|
||||||
|
@ -445,6 +445,7 @@ defmodule Pleroma.Web.CommonAPITest do
|
|||||||
object = Object.normalize(activity)
|
object = Object.normalize(activity)
|
||||||
|
|
||||||
assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')"
|
assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')"
|
||||||
|
assert object.data["source"] == post
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it filters out obviously bad tags when accepting a post as Markdown" do
|
test "it filters out obviously bad tags when accepting a post as Markdown" do
|
||||||
@ -461,6 +462,7 @@ defmodule Pleroma.Web.CommonAPITest do
|
|||||||
object = Object.normalize(activity)
|
object = Object.normalize(activity)
|
||||||
|
|
||||||
assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')"
|
assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')"
|
||||||
|
assert object.data["source"] == post
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it does not allow replies to direct messages that are not direct messages themselves" do
|
test "it does not allow replies to direct messages that are not direct messages themselves" do
|
||||||
|
Loading…
Reference in New Issue
Block a user