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
10f39584
Commit
10f39584
authored
Nov 01, 2018
by
kaniini
Browse files
object: return the deleted object as well
parent
68a14056
Pipeline
#4217
passed with stages
in 5 minutes and 36 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
lib/pleroma/object.ex
View file @
10f39584
...
...
@@ -57,7 +57,7 @@ def delete(%Object{data: %{"id" => id}} = object) do
with
Repo
.
delete
(
object
),
Repo
.
delete_all
(
Activity
.
all_non_create_by_object_ap_id_q
(
id
)),
{
:ok
,
true
}
<-
Cachex
.
del
(
:user_cache
,
"object:
#{
id
}
"
)
do
:ok
{
:ok
,
object
}
end
end
end
lib/pleroma/web/activity_pub/activity_pub.ex
View file @
10f39584
...
...
@@ -273,7 +273,7 @@ def delete(%Object{data: %{"id" => id, "actor" => actor}} = object, local \\ tru
"to"
=>
[
user
.
follower_address
,
"https://www.w3.org/ns/activitystreams#Public"
]
}
with
Object
.
delete
(
object
),
with
{
:ok
,
_
}
<-
Object
.
delete
(
object
),
{
:ok
,
activity
}
<-
insert
(
data
,
local
),
:ok
<-
maybe_federate
(
activity
),
{
:ok
,
_actor
}
<-
User
.
decrease_note_count
(
user
)
do
...
...
Write
Preview
Markdown
is supported
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