Skip to content

Commit

Permalink
https://github.com/bonfire-networks/bonfire-app/issues/924
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Aug 18, 2024
1 parent d8b11db commit 128efbb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/boosts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ defmodule Bonfire.Social.Boosts do
pointer: e(boost.edge, :object, nil) || e(boost.edge, :object_id, nil)
) do
ActivityPub.unannounce(%{actor: booster, object: object})
else
{:error, :not_found} ->
:ignore

e ->
error(e)
end
end

Expand All @@ -352,8 +358,11 @@ defmodule Bonfire.Social.Boosts do
) do
ActivityPub.announce(%{actor: booster, object: object, pointer: ulid(boost)})
else
{:error, :not_found} ->
:ignore

e ->
error(e, "Could not find the federated actor or object to boost.")
error(e)
end
end

Expand Down
12 changes: 12 additions & 0 deletions lib/likes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,12 @@ defmodule Bonfire.Social.Likes do
pointer: e(like.edge, :object, nil) || like.edge.object_id
) do
ActivityPub.unlike(%{actor: liker, object: object})
else
{:error, :not_found} ->
:ignore

e ->
error(e)
end
end

Expand All @@ -400,6 +406,12 @@ defmodule Bonfire.Social.Likes do
pointer: e(like.edge, :object, nil) || like.edge.object_id
) do
ActivityPub.like(%{actor: liker, object: object, pointer: ulid(like)})
else
{:error, :not_found} ->
:ignore

e ->
error(e)
end
end

Expand Down

0 comments on commit 128efbb

Please sign in to comment.