Lint
Ref: fix-local-public
This commit is contained in:
parent
826deb7375
commit
466568ae36
2 changed files with 10 additions and 4 deletions
|
@ -58,7 +58,10 @@ defmodule Pleroma.Activity.Search do
|
|||
def maybe_restrict_blocked(query, _), do: query
|
||||
|
||||
defp restrict_public(q, user) when not is_nil(user) do
|
||||
intended_recipients = [Pleroma.Constants.as_public(), Pleroma.Web.ActivityPub.Utils.as_local_public()]
|
||||
intended_recipients = [
|
||||
Pleroma.Constants.as_public(),
|
||||
Pleroma.Web.ActivityPub.Utils.as_local_public()
|
||||
]
|
||||
|
||||
from([a, o] in q,
|
||||
where: fragment("?->>'type' = 'Create'", a.data),
|
||||
|
|
|
@ -83,7 +83,8 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
|
|||
user = insert(:user)
|
||||
%{conn: conn} = oauth_access(["read:search"])
|
||||
|
||||
{:ok, activity} = CommonAPI.post(user, %{status: "This is about 2hu private 天子", visibility: "local"})
|
||||
{:ok, activity} =
|
||||
CommonAPI.post(user, %{status: "This is about 2hu private 天子", visibility: "local"})
|
||||
|
||||
results =
|
||||
conn
|
||||
|
@ -98,7 +99,8 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
|
|||
user = insert(:user)
|
||||
%{conn: conn} = oauth_access([])
|
||||
|
||||
{:ok, _activity} = CommonAPI.post(user, %{status: "This is about 2hu private 天子", visibility: "local"})
|
||||
{:ok, _activity} =
|
||||
CommonAPI.post(user, %{status: "This is about 2hu private 天子", visibility: "local"})
|
||||
|
||||
results =
|
||||
conn
|
||||
|
@ -111,7 +113,8 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
|
|||
test "search local-only status as an anonymous user" do
|
||||
user = insert(:user)
|
||||
|
||||
{:ok, _activity} = CommonAPI.post(user, %{status: "This is about 2hu private 天子", visibility: "local"})
|
||||
{:ok, _activity} =
|
||||
CommonAPI.post(user, %{status: "This is about 2hu private 天子", visibility: "local"})
|
||||
|
||||
results =
|
||||
build_conn()
|
||||
|
|
Loading…
Reference in a new issue