Merge pull request #9047 from jitsi/tavram/sip-invite-fixes

fix(sip-invite) add minor fixes to sip invite flow
This commit is contained in:
Avram Tudor 2021-04-22 12:13:45 +03:00 committed by GitHub
commit 6398b4ec89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 9 deletions

View File

@ -81,7 +81,7 @@ export function invite(
dispatch(setCalleeInfoVisible(true, invitees[0])); dispatch(setCalleeInfoVisible(true, invitees[0]));
} }
const { conference } = state['features/base/conference']; const { conference, password } = state['features/base/conference'];
if (typeof conference === 'undefined') { if (typeof conference === 'undefined') {
// Invite will fail before CONFERENCE_JOIN. The request will be // Invite will fail before CONFERENCE_JOIN. The request will be
@ -177,7 +177,7 @@ export function invite(
sipInviteUrl, sipInviteUrl,
jwt, jwt,
conference.options.name, conference.options.name,
conference.password, password,
displayName displayName
); );

View File

@ -160,7 +160,7 @@ export default class AbstractAddPeopleDialog<P: Props, S: State>
if (invitedCount >= 3) { if (invitedCount >= 3) {
notificationProps = { notificationProps = {
titleArguments: { titleArguments: {
name: invitees[0].name, name: invitees[0].name || invitees[0].address,
count: invitedCount - 1 count: invitedCount - 1
}, },
titleKey: 'notify.invitedThreePlusMembers' titleKey: 'notify.invitedThreePlusMembers'
@ -168,15 +168,15 @@ export default class AbstractAddPeopleDialog<P: Props, S: State>
} else if (invitedCount === 2) { } else if (invitedCount === 2) {
notificationProps = { notificationProps = {
titleArguments: { titleArguments: {
first: invitees[0].name, first: invitees[0].name || invitees[0].address,
second: invitees[1].name second: invitees[1].name || invitees[1].address
}, },
titleKey: 'notify.invitedTwoMembers' titleKey: 'notify.invitedTwoMembers'
}; };
} else if (invitedCount) { } else if (invitedCount) {
notificationProps = { notificationProps = {
titleArguments: { titleArguments: {
name: invitees[0].name name: invitees[0].name || invitees[0].address
}, },
titleKey: 'notify.invitedOneMember' titleKey: 'notify.invitedOneMember'
}; };

View File

@ -356,7 +356,7 @@ class InviteContactsForm extends AbstractAddPeopleDialog<Props, State> {
filterValues: [ filterValues: [
sip.address sip.address
], ],
content: t('addPeople.sip', { address: sip.address }), content: sip.address,
description: '', description: '',
item: sip, item: sip,
value: sip.address value: sip.address

View File

@ -6,6 +6,7 @@ import { ScrollView, Text, View, TouchableOpacity } from 'react-native';
import { Avatar } from '../../../base/avatar'; import { Avatar } from '../../../base/avatar';
import { translate } from '../../../base/i18n'; import { translate } from '../../../base/i18n';
import { connect } from '../../../base/redux'; import { connect } from '../../../base/redux';
import { HIDDEN_EMAILS } from '../../constants';
import AbstractKnockingParticipantList, { import AbstractKnockingParticipantList, {
mapStateToProps as abstractMapStateToProps, mapStateToProps as abstractMapStateToProps,
type Props type Props
@ -44,7 +45,7 @@ class KnockingParticipantList extends AbstractKnockingParticipantList {
<Text style = { styles.knockingParticipantListText }> <Text style = { styles.knockingParticipantListText }>
{ p.name } { p.name }
</Text> </Text>
{ p.email && ( { p.email && !HIDDEN_EMAILS.includes(p.email) && (
<Text style = { styles.knockingParticipantListText }> <Text style = { styles.knockingParticipantListText }>
{ p.email } { p.email }
</Text> </Text>

View File

@ -6,6 +6,7 @@ import { Avatar } from '../../../base/avatar';
import { translate } from '../../../base/i18n'; import { translate } from '../../../base/i18n';
import { connect } from '../../../base/redux'; import { connect } from '../../../base/redux';
import { isToolboxVisible } from '../../../toolbox/functions.web'; import { isToolboxVisible } from '../../../toolbox/functions.web';
import { HIDDEN_EMAILS } from '../../constants';
import AbstractKnockingParticipantList, { import AbstractKnockingParticipantList, {
mapStateToProps as abstractMapStateToProps, mapStateToProps as abstractMapStateToProps,
type Props as AbstractProps type Props as AbstractProps
@ -56,7 +57,7 @@ class KnockingParticipantList extends AbstractKnockingParticipantList<Props> {
<span data-testid = 'knockingParticipant.name'> <span data-testid = 'knockingParticipant.name'>
{ p.name } { p.name }
</span> </span>
{ p.email && ( { p.email && !HIDDEN_EMAILS.includes(p.email) && (
<span data-testid = 'knockingParticipant.email'> <span data-testid = 'knockingParticipant.email'>
{ p.email } { p.email }
</span> </span>

View File

@ -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' ];