Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
fdf1dfed
Verified
Commit
fdf1dfed
authored
Feb 01, 2021
by
Alexander Strizhakov
Browse files
only_remote -> remote renaming
parent
ba512cbe
Pipeline
#34557
passed with stages
in 9 minutes and 33 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
fdf1dfed
...
...
@@ -49,7 +49,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
-
Admin API: An endpoint to manage frontends.
-
Streaming API: Add follow relationships updates.
-
WebPush: Introduce
`pleroma:chat_mention`
and
`pleroma:emoji_reaction`
notification types.
-
Mastodon API: Home, public, hashtag & list timelines accept
`only_media`
,
`
only_
remote`
&
`local`
parameters for filtration.
-
Mastodon API: Home, public, hashtag & list timelines accept
`only_media`
,
`remote`
&
`local`
parameters for filtration.
</details>
### Fixed
...
...
docs/development/API/differences_in_mastoapi_responses.md
View file @
fdf1dfed
...
...
@@ -20,7 +20,7 @@ Home, public, hashtag & list timelines accept these parameters:
-
`only_media`
: show only statuses with media attached
-
`local`
: show only local statuses
-
`
only_
remote`
: show only remote statuses
-
`remote`
: show only remote statuses
## Statuses
...
...
lib/pleroma/web/activity_pub/activity_pub.ex
View file @
fdf1dfed
...
...
@@ -735,7 +735,7 @@ defp restrict_local(query, %{local_only: true}) do
defp
restrict_local
(
query
,
_
),
do
:
query
defp
restrict_remote
(
query
,
%{
only_
remote:
true
})
do
defp
restrict_remote
(
query
,
%{
remote:
true
})
do
from
(
activity
in
query
,
where:
activity
.
local
==
false
)
end
...
...
lib/pleroma/web/api_spec/operations/timeline_operation.ex
View file @
fdf1dfed
...
...
@@ -25,7 +25,7 @@ def home_operation do
security:
[%{
"oAuth"
=>
[
"read:statuses"
]}],
parameters:
[
local_param
(),
only_
remote_param
(),
remote_param
(),
only_media_param
(),
with_muted_param
(),
exclude_visibilities_param
(),
...
...
@@ -63,7 +63,7 @@ def public_operation do
local_param
(),
instance_param
(),
only_media_param
(),
only_
remote_param
(),
remote_param
(),
with_muted_param
(),
exclude_visibilities_param
(),
reply_visibility_param
()
|
pagination_params
()
...
...
@@ -110,7 +110,7 @@ def hashtag_operation do
),
local_param
(),
only_media_param
(),
only_
remote_param
(),
remote_param
(),
with_muted_param
(),
exclude_visibilities_param
()
|
pagination_params
()
],
...
...
@@ -137,7 +137,7 @@ def list_operation do
),
with_muted_param
(),
local_param
(),
only_
remote_param
(),
remote_param
(),
only_media_param
(),
exclude_visibilities_param
()
|
pagination_params
()
],
...
...
@@ -206,9 +206,9 @@ defp only_media_param do
)
end
defp
only_
remote_param
do
defp
remote_param
do
Operation
.
parameter
(
:
only_
remote
,
:remote
,
:query
,
%
Schema
{
allOf:
[
BooleanLike
],
default:
false
},
"Show only remote statuses?"
...
...
test/pleroma/web/mastodon_api/controllers/timeline_controller_test.exs
View file @
fdf1dfed
...
...
@@ -131,22 +131,22 @@ test "filtering", %{conn: conn, user: user} do
refute
remote_activity
.
id
in
only_local_media_ids
assert
with_media
.
id
in
only_local_media_ids
only_
remote_ids
=
remote_ids
=
conn
|>
get
(
"/api/v1/timelines/home?
only_
remote=true"
)
|>
get
(
"/api/v1/timelines/home?remote=true"
)
|>
json_response_and_validate_schema
(
200
)
|>
Enum
.
map
(
&
&1
[
"id"
])
refute
local_activity
.
id
in
only_
remote_ids
assert
remote_activity
.
id
in
only_
remote_ids
refute
with_media
.
id
in
only_
remote_ids
refute
local_activity
.
id
in
remote_ids
assert
remote_activity
.
id
in
remote_ids
refute
with_media
.
id
in
remote_ids
assert
conn
|>
get
(
"/api/v1/timelines/home?
only_
remote=true&only_media=true"
)
|>
get
(
"/api/v1/timelines/home?remote=true&only_media=true"
)
|>
json_response_and_validate_schema
(
200
)
==
[]
assert
conn
|>
get
(
"/api/v1/timelines/home?
only_
remote=true&local=true"
)
|>
get
(
"/api/v1/timelines/home?remote=true&local=true"
)
|>
json_response_and_validate_schema
(
200
)
==
[]
end
end
...
...
@@ -210,7 +210,7 @@ test "the public timeline", %{conn: conn} do
assert
[%{
"id"
=>
^
remote_id
}]
=
conn
|>
get
(
"/api/v1/timelines/public?
only_
remote=true"
)
|>
get
(
"/api/v1/timelines/public?remote=true"
)
|>
json_response_and_validate_schema
(
:ok
)
with_media_id
=
with_media
.
id
...
...
@@ -221,7 +221,7 @@ test "the public timeline", %{conn: conn} do
|>
json_response_and_validate_schema
(
:ok
)
assert
conn
|>
get
(
"/api/v1/timelines/public?
only_
remote=true&only_media=true"
)
|>
get
(
"/api/v1/timelines/public?remote=true&only_media=true"
)
|>
json_response_and_validate_schema
(
:ok
)
==
[]
# does not contain repeats
...
...
@@ -657,7 +657,7 @@ test "muted emotions", %{user: user, conn: conn} do
]
=
result
end
test
"filering"
,
%{
user:
user
,
conn:
conn
}
do
test
"fil
t
ering"
,
%{
user:
user
,
conn:
conn
}
do
{
:ok
,
list
}
=
Pleroma
.
List
.
create
(
"name"
,
user
)
local_user
=
insert
(
:user
)
...
...
@@ -699,18 +699,18 @@ test "filering", %{user: user, conn: conn} do
assert
with_media
.
id
in
only_local_media_ids
refute
remote_activity
.
id
in
only_local_media_ids
only_
remote_ids
=
remote_ids
=
conn
|>
get
(
"/api/v1/timelines/list/
#{
list
.
id
}
?
only_
remote=true"
)
|>
get
(
"/api/v1/timelines/list/
#{
list
.
id
}
?remote=true"
)
|>
json_response_and_validate_schema
(
200
)
|>
Enum
.
map
(
&
&1
[
"id"
])
refute
local_activity
.
id
in
only_
remote_ids
refute
with_media
.
id
in
only_
remote_ids
assert
remote_activity
.
id
in
only_
remote_ids
refute
local_activity
.
id
in
remote_ids
refute
with_media
.
id
in
remote_ids
assert
remote_activity
.
id
in
remote_ids
assert
conn
|>
get
(
"/api/v1/timelines/list/
#{
list
.
id
}
?
only_
remote=true&only_media=true"
)
|>
get
(
"/api/v1/timelines/list/
#{
list
.
id
}
?remote=true&only_media=true"
)
|>
json_response_and_validate_schema
(
200
)
==
[]
only_media_ids
=
...
...
@@ -724,9 +724,7 @@ test "filering", %{user: user, conn: conn} do
refute
remote_activity
.
id
in
only_media_ids
assert
conn
|>
get
(
"/api/v1/timelines/list/
#{
list
.
id
}
?only_media=true&local=true&only_remote=true"
)
|>
get
(
"/api/v1/timelines/list/
#{
list
.
id
}
?only_media=true&local=true&remote=true"
)
|>
json_response_and_validate_schema
(
200
)
==
[]
end
end
...
...
@@ -777,7 +775,7 @@ test "hashtag timeline", %{conn: conn} do
remote_ids
=
conn
|>
get
(
"/api/v1/timelines/tag/2hu?
only_
remote=true"
)
|>
get
(
"/api/v1/timelines/tag/2hu?remote=true"
)
|>
json_response_and_validate_schema
(
:ok
)
|>
Enum
.
map
(
&
&1
[
"id"
])
...
...
@@ -807,7 +805,7 @@ test "hashtag timeline", %{conn: conn} do
ids
=
conn
|>
get
(
"/api/v1/timelines/tag/2hu?only_media=true&local=true&
only_
remote=true"
)
|>
get
(
"/api/v1/timelines/tag/2hu?only_media=true&local=true&remote=true"
)
|>
json_response_and_validate_schema
(
:ok
)
|>
Enum
.
map
(
&
&1
[
"id"
])
...
...
@@ -816,7 +814,7 @@ test "hashtag timeline", %{conn: conn} do
refute
remote_activity
.
id
in
ids
assert
conn
|>
get
(
"/api/v1/timelines/tag/2hu?only_media=true&
only_
remote=true"
)
|>
get
(
"/api/v1/timelines/tag/2hu?only_media=true&remote=true"
)
|>
json_response_and_validate_schema
(
:ok
)
==
[]
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment