combined outgoing_blocks with statement

This commit is contained in:
squidboi 2018-06-24 23:05:44 -07:00
parent c4038ede07
commit ea214b8ba6
No known key found for this signature in database
GPG Key ID: 018925A9B65D2457
1 changed files with 5 additions and 6 deletions

View File

@ -255,12 +255,11 @@ def block(blocker, blocked, activity_id \\ nil, local \\ true) do
end
end
with true <- outgoing_blocks do
with block_data <- make_block_data(blocker, blocked, activity_id),
{:ok, activity} <- insert(block_data, local),
:ok <- maybe_federate(activity) do
{:ok, activity}
end
with true <- outgoing_blocks,
block_data <- make_block_data(blocker, blocked, activity_id),
{:ok, activity} <- insert(block_data, local),
:ok <- maybe_federate(activity) do
{:ok, activity}
else
_e -> {:ok, nil}
end