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
64b0120d
Commit
64b0120d
authored
Mar 14, 2019
by
kaniini
Browse files
activitypub: add support for forwarding reports
parent
3b48d5f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/activity_pub/activity_pub.ex
View file @
64b0120d
...
...
@@ -370,20 +370,32 @@ def flag(
content:
content
}
=
params
)
do
additional
=
params
[
:additional
]
||
%{}
# only accept false as false value
local
=
!
(
params
[
:local
]
==
false
)
forward
=
!
(
params
[
:forward
]
==
false
)
additional
=
params
[
:additional
]
||
%{}
%{
params
=
%{
actor:
actor
,
context:
context
,
account:
account
,
statuses:
statuses
,
content:
content
}
|>
make_flag_data
(
additional
)
|>
insert
(
local
)
additional
=
if
forward
do
Map
.
merge
(
additional
,
%{
"to"
=>
[],
"cc"
=>
[
account
.
ap_id
]})
else
additional
end
with
flag_data
<-
make_flag_data
(
params
,
additional
),
{
:ok
,
activity
}
<-
insert
(
flag_data
,
local
),
:ok
<-
maybe_federate
(
activity
)
do
{
:ok
,
activity
}
end
end
def
fetch_activities_for_context
(
context
,
opts
\\
%{})
do
...
...
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