From f0f9c024523f12a0363c374ad1ee7dee953883ed Mon Sep 17 00:00:00 2001 From: Tudor-Ovidiu Avram Date: Tue, 20 Apr 2021 16:05:49 +0300 Subject: [PATCH] fix(sip-invite) add minor fixes to sip invite flow --- react/features/invite/actions.any.js | 4 ++-- .../add-people-dialog/AbstractAddPeopleDialog.js | 8 ++++---- .../add-people-dialog/web/InviteContactsForm.js | 2 +- .../lobby/components/native/KnockingParticipantList.js | 3 ++- .../lobby/components/web/KnockingParticipantList.js | 3 ++- react/features/lobby/constants.js | 4 ++++ 6 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 react/features/lobby/constants.js diff --git a/react/features/invite/actions.any.js b/react/features/invite/actions.any.js index 2bae83ef9..893890426 100644 --- a/react/features/invite/actions.any.js +++ b/react/features/invite/actions.any.js @@ -81,7 +81,7 @@ export function invite( dispatch(setCalleeInfoVisible(true, invitees[0])); } - const { conference } = state['features/base/conference']; + const { conference, password } = state['features/base/conference']; if (typeof conference === 'undefined') { // Invite will fail before CONFERENCE_JOIN. The request will be @@ -177,7 +177,7 @@ export function invite( sipInviteUrl, jwt, conference.options.name, - conference.password, + password, displayName ); diff --git a/react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.js b/react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.js index 794d30311..57d0d3da3 100644 --- a/react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.js +++ b/react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.js @@ -160,7 +160,7 @@ export default class AbstractAddPeopleDialog if (invitedCount >= 3) { notificationProps = { titleArguments: { - name: invitees[0].name, + name: invitees[0].name || invitees[0].address, count: invitedCount - 1 }, titleKey: 'notify.invitedThreePlusMembers' @@ -168,15 +168,15 @@ export default class AbstractAddPeopleDialog } else if (invitedCount === 2) { notificationProps = { titleArguments: { - first: invitees[0].name, - second: invitees[1].name + first: invitees[0].name || invitees[0].address, + second: invitees[1].name || invitees[1].address }, titleKey: 'notify.invitedTwoMembers' }; } else if (invitedCount) { notificationProps = { titleArguments: { - name: invitees[0].name + name: invitees[0].name || invitees[0].address }, titleKey: 'notify.invitedOneMember' }; diff --git a/react/features/invite/components/add-people-dialog/web/InviteContactsForm.js b/react/features/invite/components/add-people-dialog/web/InviteContactsForm.js index fbeb46797..7b108a23e 100644 --- a/react/features/invite/components/add-people-dialog/web/InviteContactsForm.js +++ b/react/features/invite/components/add-people-dialog/web/InviteContactsForm.js @@ -356,7 +356,7 @@ class InviteContactsForm extends AbstractAddPeopleDialog { filterValues: [ sip.address ], - content: t('addPeople.sip', { address: sip.address }), + content: sip.address, description: '', item: sip, value: sip.address diff --git a/react/features/lobby/components/native/KnockingParticipantList.js b/react/features/lobby/components/native/KnockingParticipantList.js index e511f70d8..192dbba63 100644 --- a/react/features/lobby/components/native/KnockingParticipantList.js +++ b/react/features/lobby/components/native/KnockingParticipantList.js @@ -6,6 +6,7 @@ import { ScrollView, Text, View, TouchableOpacity } from 'react-native'; import { Avatar } from '../../../base/avatar'; import { translate } from '../../../base/i18n'; import { connect } from '../../../base/redux'; +import { HIDDEN_EMAILS } from '../../constants'; import AbstractKnockingParticipantList, { mapStateToProps as abstractMapStateToProps, type Props @@ -44,7 +45,7 @@ class KnockingParticipantList extends AbstractKnockingParticipantList { { p.name } - { p.email && ( + { p.email && !HIDDEN_EMAILS.includes(p.email) && ( { p.email } diff --git a/react/features/lobby/components/web/KnockingParticipantList.js b/react/features/lobby/components/web/KnockingParticipantList.js index 3a358d9e8..679004008 100644 --- a/react/features/lobby/components/web/KnockingParticipantList.js +++ b/react/features/lobby/components/web/KnockingParticipantList.js @@ -6,6 +6,7 @@ import { Avatar } from '../../../base/avatar'; import { translate } from '../../../base/i18n'; import { connect } from '../../../base/redux'; import { isToolboxVisible } from '../../../toolbox/functions.web'; +import { HIDDEN_EMAILS } from '../../constants'; import AbstractKnockingParticipantList, { mapStateToProps as abstractMapStateToProps, type Props as AbstractProps @@ -56,7 +57,7 @@ class KnockingParticipantList extends AbstractKnockingParticipantList { { p.name } - { p.email && ( + { p.email && !HIDDEN_EMAILS.includes(p.email) && ( { p.email } diff --git a/react/features/lobby/constants.js b/react/features/lobby/constants.js new file mode 100644 index 000000000..9140a92fa --- /dev/null +++ b/react/features/lobby/constants.js @@ -0,0 +1,4 @@ +/** + * Hide these emails when trying to join a lobby + */ +export const HIDDEN_EMAILS = [ 'inbound-sip-jibri@jitsi.net', 'outbound-sip-jibri@jitsi.net' ];