fix(activitypub): fix receiving comments
Should fix race conditions and actors deleted of received comments Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
749e90b6c9
commit
f1084c101f
@ -81,7 +81,14 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||||||
object_data
|
object_data
|
||||||
|> transform_object_data_for_discussion()
|
|> transform_object_data_for_discussion()
|
||||||
|> save_comment_or_discussion()
|
|> save_comment_or_discussion()
|
||||||
|
|
||||||
|
{:ok, %Comment{} = comment} ->
|
||||||
|
# Object already exists
|
||||||
|
{:ok, nil, comment}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
{:error, err} ->
|
||||||
|
{:error, err}
|
||||||
end
|
end
|
||||||
|
|
||||||
{:ok, %Comment{} = comment} ->
|
{:ok, %Comment{} = comment} ->
|
||||||
|
Loading…
Reference in New Issue
Block a user