forked from YokaiRick/akkoma
Merge branch 'only-creates-in-public-tl' into 'develop'
TimelineController: Only return `Create` in public timelines. Closes #1833 and #1821 See merge request pleroma/pleroma!2618
This commit is contained in:
commit
d67b8a96c7
2 changed files with 10 additions and 3 deletions
|
@ -111,7 +111,7 @@ def public(%{assigns: %{user: user}} = conn, params) do
|
||||||
else
|
else
|
||||||
activities =
|
activities =
|
||||||
params
|
params
|
||||||
|> Map.put("type", ["Create", "Announce"])
|
|> Map.put("type", ["Create"])
|
||||||
|> Map.put("local_only", local_only)
|
|> Map.put("local_only", local_only)
|
||||||
|> Map.put("blocking_user", user)
|
|> Map.put("blocking_user", user)
|
||||||
|> Map.put("muting_user", user)
|
|> Map.put("muting_user", user)
|
||||||
|
|
|
@ -60,9 +60,9 @@ test "the home timeline when the direct messages are excluded", %{user: user, co
|
||||||
describe "public" do
|
describe "public" do
|
||||||
@tag capture_log: true
|
@tag capture_log: true
|
||||||
test "the public timeline", %{conn: conn} do
|
test "the public timeline", %{conn: conn} do
|
||||||
following = insert(:user)
|
user = insert(:user)
|
||||||
|
|
||||||
{:ok, _activity} = CommonAPI.post(following, %{status: "test"})
|
{:ok, activity} = CommonAPI.post(user, %{status: "test"})
|
||||||
|
|
||||||
_activity = insert(:note_activity, local: false)
|
_activity = insert(:note_activity, local: false)
|
||||||
|
|
||||||
|
@ -77,6 +77,13 @@ test "the public timeline", %{conn: conn} do
|
||||||
conn = get(build_conn(), "/api/v1/timelines/public?local=1")
|
conn = get(build_conn(), "/api/v1/timelines/public?local=1")
|
||||||
|
|
||||||
assert [%{"content" => "test"}] = json_response_and_validate_schema(conn, :ok)
|
assert [%{"content" => "test"}] = json_response_and_validate_schema(conn, :ok)
|
||||||
|
|
||||||
|
# does not contain repeats
|
||||||
|
{:ok, _} = CommonAPI.repeat(activity.id, user)
|
||||||
|
|
||||||
|
conn = get(build_conn(), "/api/v1/timelines/public?local=true")
|
||||||
|
|
||||||
|
assert [_] = json_response_and_validate_schema(conn, :ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "the public timeline includes only public statuses for an authenticated user" do
|
test "the public timeline includes only public statuses for an authenticated user" do
|
||||||
|
|
Loading…
Reference in a new issue