Browse Source
fix(participants): Don't throw an exception when inviting the same email twice
Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/10694/head
Joas Schilling
2 years ago
No known key found for this signature in database
GPG Key ID: 74434EFE0D2E2205
2 changed files with
9 additions and
3 deletions
-
lib/Controller/RoomController.php
-
tests/integration/features/conversation/invite-email.feature
|
|
@ -1070,9 +1070,12 @@ class RoomController extends AEnvironmentAwareController { |
|
|
|
$data = ['type' => $this->room->getType()]; |
|
|
|
} |
|
|
|
|
|
|
|
$participant = $this->participantService->inviteEmailAddress($this->room, $newParticipant); |
|
|
|
|
|
|
|
$this->guestManager->sendEmailInvitation($this->room, $participant); |
|
|
|
try { |
|
|
|
$this->participantService->getParticipantByActor($this->room, Attendee::ACTOR_EMAILS, $newParticipant); |
|
|
|
} catch (ParticipantNotFoundException) { |
|
|
|
$participant = $this->participantService->inviteEmailAddress($this->room, $newParticipant); |
|
|
|
$this->guestManager->sendEmailInvitation($this->room, $participant); |
|
|
|
} |
|
|
|
|
|
|
|
return new DataResponse($data); |
|
|
|
} elseif ($source === 'remotes') { |
|
|
|
|
|
@ -7,6 +7,9 @@ Feature: conversation/invite-email) |
|
|
|
| roomType | 3 | |
|
|
|
| roomName | room | |
|
|
|
When user "participant1" adds email "test@example.tld" to room "room" with 200 (v4) |
|
|
|
# Adding the same email again should not error to help the Calendar integration |
|
|
|
# Ref https://github.com/nextcloud/calendar/pull/5380 |
|
|
|
When user "participant1" adds email "test@example.tld" to room "room" with 200 (v4) |
|
|
|
Then user "participant1" sees the following attendees in room "room" with 200 (v4) |
|
|
|
| participantType | inCall | actorType | actorId | |
|
|
|
| 4 | 0 | emails | test@example.tld | |
|
|
|