Browse Source

Adjust invitation resending after reviews

Remove userId legacy argument, only use attendeeId for resending.
Remove "email" from wordings.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Co-authored-by: Joas Schilling <coding@schilljs.com>
pull/5052/head
Vincent Petry 5 years ago
parent
commit
d497e2a183
No known key found for this signature in database GPG Key ID: E055D6A4D513575C
  1. 3
      docs/participant.md
  2. 12
      lib/Controller/RoomController.php
  3. 6
      src/components/ConversationSettings/LinkShareSettings.vue
  4. 4
      src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue
  5. 4
      src/services/participantsService.js
  6. 5
      src/store/participantsStore.js

3
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)

12
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

6
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
},

4
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() {

4
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,
})
}

5
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 })
},
}

Loading…
Cancel
Save