forked from potsda.mn/mobilizon
Fix crash when trying to notify activities not from groups
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
cc806265cc
commit
f5aa7ffa74
|
@ -33,7 +33,7 @@ defmodule Mobilizon.Service.Workers.ActivityBuilder do
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec users_to_notify(Activity.t()) :: list(User.t())
|
@spec users_to_notify(Activity.t()) :: list(User.t())
|
||||||
defp users_to_notify(%Activity{group: %Actor{} = group, author_id: author_id}) do
|
defp users_to_notify(%Activity{group: %Actor{type: :Group} = group, author_id: author_id}) do
|
||||||
group
|
group
|
||||||
|> Actors.list_internal_actors_members_for_group([
|
|> Actors.list_internal_actors_members_for_group([
|
||||||
:creator,
|
:creator,
|
||||||
|
@ -47,4 +47,6 @@ defmodule Mobilizon.Service.Workers.ActivityBuilder do
|
||||||
|> Enum.uniq()
|
|> Enum.uniq()
|
||||||
|> Enum.map(&Users.get_user_with_settings!/1)
|
|> Enum.map(&Users.get_user_with_settings!/1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp users_to_notify(_), do: []
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue