diff --git a/src/components/NewConversationDialog/NewConversationContactsPage.vue b/src/components/NewConversationDialog/NewConversationContactsPage.vue index c48b661b158..6ba0b1f7a6b 100644 --- a/src/components/NewConversationDialog/NewConversationContactsPage.vue +++ b/src/components/NewConversationDialog/NewConversationContactsPage.vue @@ -76,6 +76,7 @@ import DialpadPanel from '../UIShared/DialpadPanel.vue' import TransitionWrapper from '../UIShared/TransitionWrapper.vue' import { useArrowNavigation } from '../../composables/useArrowNavigation.js' +import { SHARE } from '../../constants.js' import { autocompleteQuery } from '../../services/coreService.ts' import CancelableRequest from '../../utils/cancelableRequest.js' @@ -208,7 +209,11 @@ export default { const { request, cancel } = CancelableRequest(autocompleteQuery) this.cancelSearchPossibleConversations = cancel - const response = await request({ searchText: this.searchText }) + const response = await request({ + searchText: this.searchText, + token: 'new', + forceTypes: [SHARE.TYPE.EMAIL], // e-mail guests are allowed directly after conversation creation + }) this.searchResults = response?.data?.ocs?.data || [] if (this.searchResults.length === 0) { diff --git a/src/components/NewConversationDialog/NewConversationDialog.vue b/src/components/NewConversationDialog/NewConversationDialog.vue index 3d9d880200e..7c4ac3cc64d 100644 --- a/src/components/NewConversationDialog/NewConversationDialog.vue +++ b/src/components/NewConversationDialog/NewConversationDialog.vue @@ -109,6 +109,7 @@ import { provide, ref } from 'vue' import AlertCircle from 'vue-material-design-icons/AlertCircle.vue' import Check from 'vue-material-design-icons/Check.vue' +import { showSuccess } from '@nextcloud/dialogs' import { t } from '@nextcloud/l10n' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' @@ -121,7 +122,7 @@ import LoadingComponent from '../LoadingComponent.vue' import { useId } from '../../composables/useId.ts' import { useIsInCall } from '../../composables/useIsInCall.js' -import { CONVERSATION } from '../../constants.js' +import { ATTENDEE, CONVERSATION } from '../../constants.js' import { setConversationPassword } from '../../services/conversationsService.js' import { addParticipant } from '../../services/participantsService.js' import { copyConversationLinkToClipboard } from '../../utils/handleUrl.ts' @@ -328,6 +329,11 @@ export default { } await Promise.all(promises) + + this.selectedParticipants.filter(participant => participant?.source === ATTENDEE.ACTOR_TYPE.EMAILS) + .forEach(participant => { + showSuccess(t('spreed', 'Invitation was sent to {actorId}', { actorId: participant.id })) + }) } catch (exception) { console.error('Error creating new conversation: ', exception) this.isLoading = false diff --git a/src/services/coreService.ts b/src/services/coreService.ts index 267f86d2c11..aa88642dedb 100644 --- a/src/services/coreService.ts +++ b/src/services/coreService.ts @@ -17,6 +17,7 @@ type SearchPayload = { searchText: string token?: string | 'new' onlyUsers?: boolean + forceTypes?: typeof SHARE.TYPE[keyof typeof SHARE.TYPE][] } /** @@ -26,18 +27,19 @@ type SearchPayload = { * @param payload.searchText The string that will be used in the search query. * @param [payload.token] The token of the conversation (if any) | 'new' for new conversations * @param [payload.onlyUsers] Whether to return only registered users + * @param [payload.forceTypes] Whether to force some types to be included in query * @param options options */ -const autocompleteQuery = async function({ searchText, token = 'new', onlyUsers = false }: SearchPayload, options: object) { +const autocompleteQuery = async function({ searchText, token = 'new', onlyUsers = false, forceTypes = [] }: SearchPayload, options: object) { const shareTypes = onlyUsers - ? [SHARE.TYPE.USER] + ? [SHARE.TYPE.USER].concat(forceTypes) : [ SHARE.TYPE.USER, SHARE.TYPE.GROUP, SHARE.TYPE.CIRCLE, token !== 'new' ? SHARE.TYPE.EMAIL : null, canInviteToFederation ? SHARE.TYPE.REMOTE : null, - ].filter(type => type !== null) + ].filter(type => type !== null).concat(forceTypes) return axios.get(generateOcsUrl('core/autocomplete/get'), { ...options,