feat(notifications): add missing notifications when an user registers to an event

Closes #1344

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-08-24 11:42:03 +02:00
parent f99267c611
commit da532c7059
15 changed files with 149 additions and 15 deletions

View File

@@ -82,6 +82,11 @@ defmodule Mobilizon.Federation.ActivityPub.Actions.Accept do
)
Scheduler.trigger_notifications_for_participant(participant)
Mobilizon.Service.Activity.Participant.insert_activity(participant,
subject: "event_new_participation"
)
participant_as_data = Convertible.model_to_as(participant)
audience = Audience.get_audience(participant)

View File

@@ -224,6 +224,10 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Events do
cond do
Mobilizon.Events.get_default_participant_role(event) == :participant &&
role == :participant ->
Mobilizon.Service.Activity.Participant.insert_activity(participant,
subject: "event_new_participation"
)
{:accept,
Actions.Accept.accept(
:join,