Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Jorin
pleroma
Commits
643fae6e
Commit
643fae6e
authored
6 years ago
by
kaniini
Browse files
Options
Downloads
Patches
Plain Diff
activitypub: allow querying the activity/object graph bounded to a specific to/cc set
parent
9cac7c95
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/pleroma/web/activity_pub/activity_pub.ex
+21
-0
21 additions, 0 deletions
lib/pleroma/web/activity_pub/activity_pub.ex
with
21 additions
and
0 deletions
lib/pleroma/web/activity_pub/activity_pub.ex
+
21
−
0
View file @
643fae6e
...
...
@@ -410,6 +410,20 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
defp
restrict_tag
(
query
,
_
),
do
:
query
defp
restrict_to_cc
(
query
,
recipients_to
,
recipients_cc
)
do
from
(
activity
in
query
,
where:
fragment
(
"(? && ?) or (? && ?)"
,
^
recipients_to
,
activity
.
recipients_to
,
^
recipients_cc
,
activity
.
recipients_cc
)
)
end
defp
restrict_recipients
(
query
,
[],
_user
),
do
:
query
defp
restrict_recipients
(
query
,
recipients
,
nil
)
do
...
...
@@ -551,6 +565,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|>
Enum
.
reverse
()
end
def
fetch_activities_bounded
(
recipients_to
,
recipients_cc
,
opts
\\
%{})
do
fetch_activities_query
([],
opts
)
|>
restrict_to_cc
(
recipients_to
,
recipients_cc
)
|>
Repo
.
all
()
|>
Enum
.
reverse
()
end
def
upload
(
file
)
do
data
=
Upload
.
store
(
file
,
Application
.
get_env
(
:pleroma
,
:instance
)[
:dedupe_media
])
Repo
.
insert
(%
Object
{
data:
data
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment