Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
pleroma
Merge requests
!16
MastoAPI: Add media timelines.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
MastoAPI: Add media timelines.
mastoapi-media-timeline
into
develop
Overview
0
Commits
2
Pipelines
4
Changes
2
Merged
eal
requested to merge
mastoapi-media-timeline
into
develop
7 years ago
Overview
0
Commits
2
Pipelines
4
Changes
2
Expand
Closes
#63 (closed)
.
Edited
7 years ago
by
eal
0
0
Merge request reports
Viewing commit
06c3ee3b
Prev
Next
Show latest version
2 files
+
8
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
06c3ee3b
Accept 1 as true.
· 06c3ee3b
eal
authored
7 years ago
lib/pleroma/web/activity_pub/activity_pub.ex
+
7
−
0
Options
@@ -159,6 +159,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
defp
restrict_favorited_by
(
query
,
_
),
do
:
query
defp
restrict_media
(
query
,
%{
"only_media"
=>
val
})
when
val
==
"true"
or
val
==
"1"
do
from
activity
in
query
,
where:
fragment
(
"not (? #> '{
\"
object
\"
,
\"
attachment
\"
}' = ?)"
,
activity
.
data
,
^
[])
end
defp
restrict_media
(
query
,
_
),
do
:
query
# Only search through last 100_000 activities by default
defp
restrict_recent
(
query
,
%{
"whole_db"
=>
true
}),
do
:
query
defp
restrict_recent
(
query
,
_
)
do
@@ -191,6 +197,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|>
restrict_favorited_by
(
opts
)
|>
restrict_recent
(
opts
)
|>
restrict_blocked
(
opts
)
|>
restrict_media
(
opts
)
|>
Repo
.
all
|>
Enum
.
reverse
end
Loading