diff options
-rw-r--r-- | docs/participant.md | 3 | ||||
-rw-r--r-- | lib/Controller/RoomController.php | 12 | ||||
-rw-r--r-- | src/components/ConversationSettings/LinkShareSettings.vue | 6 | ||||
-rw-r--r-- | src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue | 4 | ||||
-rw-r--r-- | src/services/participantsService.js | 4 | ||||
-rw-r--r-- | src/store/participantsStore.js | 5 |
6 files changed, 12 insertions, 22 deletions
diff --git a/docs/participant.md b/docs/participant.md index 8787c2f20..d1a288942 100644 --- a/docs/participant.md +++ b/docs/participant.md @@ -176,14 +176,13 @@ field | type | Description ------|------|------------ - `participant`| string or null | v3 | User for whom to resend invitations, or null to send to all email actors `attendeeId` | int or null | v3 | Attendee id can be used for guests and users * Response: - Status code: + `200 OK` + `403 Forbidden` When the current user is not a moderator or owner - + `404 Not Found` When the given participant was not found in the conversation + + `404 Not Found` When the given attendee was not found in the conversation ## Leave a conversation (not available for call and chat anymore) diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 31192308e..56973e318 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -1817,20 +1817,15 @@ class RoomController extends AEnvironmentAwareController { * @RequireModeratorParticipant * * @param int|null $attendeeId attendee id - * @param string|null $participant participant * @return DataResponse */ - public function resendInvitations(?int $attendeeId, ?string $participant): DataResponse { + public function resendInvitations(?int $attendeeId): DataResponse { $participants = []; // targetting specific participant - if ($participant !== null) { + if ($attendeeId !== null) { try { - if ($attendeeId !== null) { - $participants[] = $this->room->getParticipantByAttendeeId($attendeeId); - } elseif ($participant !== null) { - $participants[] = $this->room->getParticipant($participant); - } + $participants[] = $this->room->getParticipantByAttendeeId($attendeeId); } catch (ParticipantNotFoundException $e) { return new DataResponse([], Http::STATUS_NOT_FOUND); } @@ -1838,7 +1833,6 @@ class RoomController extends AEnvironmentAwareController { $participants = $this->participantService->getParticipantsForRoom($this->room); } - \OCP\Util::writeLog('spreed', '#### participants: ' . $participants , \OCP\ILogger::DEBUG); foreach ($participants as $participant) { if ($participant->getAttendee()->getActorType() === Attendee::ACTOR_EMAILS) { // generate PIN if applicable diff --git a/src/components/ConversationSettings/LinkShareSettings.vue b/src/components/ConversationSettings/LinkShareSettings.vue index 396a82292..50107662f 100644 --- a/src/components/ConversationSettings/LinkShareSettings.vue +++ b/src/components/ConversationSettings/LinkShareSettings.vue @@ -92,7 +92,7 @@ <button :disabled="isSendingInvitations" @click.prevent="handleResendInvitations"> - <span class="icon icon-mail" />{{ t('spreed', 'Resend invitation e-mails') }} + <span class="icon icon-mail" />{{ t('spreed', 'Resend invitations') }} </button> <span v-if="isSendingInvitations" class="icon-loading-small spinner" /> </div> @@ -232,9 +232,9 @@ export default { this.isSendingInvitations = true try { await this.$store.dispatch('resendInvitations', { token: this.token }) - showSuccess(t('spreed', 'Email invitations sent')) + showSuccess(t('spreed', 'Invitations sent')) } catch (e) { - showError(t('spreed', 'Error occurred when sending email invitations')) + showError(t('spreed', 'Error occurred when sending invitations')) } this.isSendingInvitations = false }, diff --git a/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue b/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue index b372515c2..7740f007b 100644 --- a/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue +++ b/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue @@ -435,9 +435,9 @@ export default { token: this.token, attendeeId: this.participant.attendeeId, }) - showSuccess(t('spreed', 'Email invitation was sent to {actorId}.', { actorId: this.participant.actorId })) + showSuccess(t('spreed', 'Invitation was sent to {actorId}.', { actorId: this.participant.actorId })) } catch (error) { - showError(t('spreed', 'Could not send email invitation to {actorId}', { actorId: this.participant.actorId })) + showError(t('spreed', 'Could not send invitation to {actorId}', { actorId: this.participant.actorId })) } }, async removeParticipant() { diff --git a/src/services/participantsService.js b/src/services/participantsService.js index 8a6cb7d8c..22ab62d8b 100644 --- a/src/services/participantsService.js +++ b/src/services/participantsService.js @@ -257,12 +257,10 @@ const setGuestUserName = async(token, userName) => { * * @param {string} token conversation token * @param {int} attendeeId attendee id to target, or null for all - * @param {string} userId user id to target, or null for all */ -const resendInvitations = async(token, { attendeeId = null, userId = null }) => { +const resendInvitations = async(token, { attendeeId = null }) => { await axios.post(generateOcsUrl('apps/spreed/api/v3/room', 2) + token + '/participants/resend-invitations', { attendeeId: attendeeId, - participant: userId, }) } diff --git a/src/store/participantsStore.js b/src/store/participantsStore.js index 88a80a3e4..394310782 100644 --- a/src/store/participantsStore.js +++ b/src/store/participantsStore.js @@ -282,10 +282,9 @@ const actions = { * @param {Object} _ unused * @param {string} token conversation token * @param {int} attendeeId attendee id to target, or null for all - * @param {string} userId user id to target, or null for all */ - async resendInvitations(_, { token, attendeeId, userId }) { - await resendInvitations(token, { attendeeId, userId }) + async resendInvitations(_, { token, attendeeId }) { + await resendInvitations(token, { attendeeId }) }, } |