include local instance in bubble timeline
Some checks failed
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/pr/docs Pipeline was successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
Some checks failed
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/pr/docs Pipeline was successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
This commit is contained in:
parent
90c4785b89
commit
d2b1b4d6c8
2 changed files with 9 additions and 20 deletions
|
@ -128,7 +128,11 @@ def public(%{assigns: %{user: user}} = conn, params) do
|
|||
|
||||
# GET /api/v1/timelines/bubble
|
||||
def bubble(%{assigns: %{user: user}} = conn, params) do
|
||||
bubble_instances = Config.get([:instance, :local_bubble], [])
|
||||
bubble_instances =
|
||||
Enum.uniq([
|
||||
Config.get([:instance, :local_bubble], []) ++
|
||||
[Pleroma.Web.Endpoint.host()]
|
||||
])
|
||||
|
||||
if is_nil(user) do
|
||||
fail_on_bad_auth(conn)
|
||||
|
|
|
@ -997,15 +997,6 @@ test "with `%{local: true, federated: false}`, forbids unauthenticated access to
|
|||
describe "bubble" do
|
||||
setup do: oauth_access(["read:statuses"])
|
||||
|
||||
test "it returns nothing if no bubble is configured", %{user: user, conn: conn} do
|
||||
clear_config([:instance, :local_bubble], [])
|
||||
{:ok, _} = CommonAPI.post(user, %{status: ".", visibility: "public"})
|
||||
|
||||
conn = get(conn, "/api/v1/timelines/bubble")
|
||||
|
||||
assert [] = json_response_and_validate_schema(conn, :ok)
|
||||
end
|
||||
|
||||
test "filtering", %{conn: conn, user: user} do
|
||||
clear_config([:instance, :local_bubble], [])
|
||||
local_user = insert(:user)
|
||||
|
@ -1016,15 +1007,8 @@ test "filtering", %{conn: conn, user: user} do
|
|||
{:ok, local_activity} = CommonAPI.post(local_user, %{status: "Status"})
|
||||
remote_activity = create_remote_activity(remote_user)
|
||||
|
||||
resp =
|
||||
conn
|
||||
|> get("/api/v1/timelines/bubble")
|
||||
|> json_response_and_validate_schema(200)
|
||||
|> Enum.map(& &1["id"])
|
||||
|
||||
assert Enum.empty?(resp)
|
||||
|
||||
clear_config([:instance, :local_bubble], ["localhost:4001"])
|
||||
# If nothing, only include ours
|
||||
clear_config([:instance, :local_bubble], [])
|
||||
|
||||
one_instance =
|
||||
conn
|
||||
|
@ -1034,7 +1018,8 @@ test "filtering", %{conn: conn, user: user} do
|
|||
|
||||
assert local_activity.id in one_instance
|
||||
|
||||
clear_config([:instance, :local_bubble], ["localhost:4001", "example.com"])
|
||||
# If we have others, also include theirs
|
||||
clear_config([:instance, :local_bubble], ["example.com"])
|
||||
|
||||
two_instances =
|
||||
conn
|
||||
|
|
Loading…
Reference in a new issue