Participation fixes

Closes #208 and #210

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-13 10:51:22 +02:00
parent 2577a2a27b
commit 57f0b5dad1
2 changed files with 21 additions and 4 deletions

View File

@@ -414,10 +414,10 @@ defmodule Mobilizon.Service.ActivityPub do
def join(%Event{options: options} = event, %Actor{} = actor, local) do
# TODO Refactor me for federation
with maximum_attendee_capacity <-
Map.get(options, :maximum_attendee_capacity, 2_000_000) || false,
Map.get(options, :maximum_attendee_capacity) || 0,
{:maximum_attendee_capacity, true} <-
{:maximum_attendee_capacity,
!maximum_attendee_capacity ||
maximum_attendee_capacity == 0 ||
Mobilizon.Events.count_participant_participants(event.id) <
maximum_attendee_capacity},
role <- Mobilizon.Events.get_default_participant_role(event),