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
303289d7
Commit
303289d7
authored
Apr 05, 2018
by
lain
Browse files
MastodonAPI search: return only create activities.
parent
f5943f4a
Pipeline
#1103
passed with stage
in 3 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
View file @
303289d7
...
...
@@ -494,6 +494,10 @@ def search(%{assigns: %{user: user}} = conn, %{"q" => query} = params) do
if
Regex
.
match?
(
~r/https?:/
,
query
)
do
with
{
:ok
,
activities
}
<-
OStatus
.
fetch_activity_from_url
(
query
)
do
activities
|>
Enum
.
filter
(
fn
%{
data:
%{
"type"
=>
"Create"
}}
->
true
_
->
false
end
)
else
_e
->
[]
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