switch to v2/calling/relays endpoint
This commit is contained in:
parent
40ac288a3a
commit
251ffc289f
2 changed files with 19 additions and 35 deletions
|
@ -88,10 +88,7 @@ import * as durations from '../util/durations';
|
||||||
import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary';
|
import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary';
|
||||||
import { fetchMembershipProof, getMembershipList } from '../groups';
|
import { fetchMembershipProof, getMembershipList } from '../groups';
|
||||||
import type { ProcessedEnvelope } from '../textsecure/Types.d';
|
import type { ProcessedEnvelope } from '../textsecure/Types.d';
|
||||||
import type {
|
import type { GetIceServersResultType } from '../textsecure/WebAPI';
|
||||||
GetIceServersResultType,
|
|
||||||
IceServerGroupType,
|
|
||||||
} from '../textsecure/WebAPI';
|
|
||||||
import { missingCaseError } from '../util/missingCaseError';
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
import { normalizeGroupCallTimestamp } from '../util/ringrtc/normalizeGroupCallTimestamp';
|
import { normalizeGroupCallTimestamp } from '../util/ringrtc/normalizeGroupCallTimestamp';
|
||||||
import {
|
import {
|
||||||
|
@ -3148,14 +3145,11 @@ export class CallingClass {
|
||||||
function iceServerConfigToList(
|
function iceServerConfigToList(
|
||||||
iceServerConfig: GetIceServersResultType
|
iceServerConfig: GetIceServersResultType
|
||||||
): Array<IceServer> {
|
): Array<IceServer> {
|
||||||
function mapConfig(
|
if (!iceServerConfig.relays) {
|
||||||
iceServerGroup: GetIceServersResultType | IceServerGroupType
|
|
||||||
): Array<IceServer> {
|
|
||||||
if (!iceServerGroup.username || !iceServerGroup.password) {
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return iceServerConfig.relays.flatMap(iceServerGroup => [
|
||||||
{
|
{
|
||||||
hostname: iceServerGroup.hostname ?? '',
|
hostname: iceServerGroup.hostname ?? '',
|
||||||
username: iceServerGroup.username,
|
username: iceServerGroup.username,
|
||||||
|
@ -3168,12 +3162,7 @@ export class CallingClass {
|
||||||
password: iceServerGroup.password,
|
password: iceServerGroup.password,
|
||||||
urls: (iceServerGroup.urls ?? []).slice(),
|
urls: (iceServerGroup.urls ?? []).slice(),
|
||||||
},
|
},
|
||||||
];
|
]);
|
||||||
}
|
|
||||||
|
|
||||||
return [iceServerConfig]
|
|
||||||
.concat(iceServerConfig.iceServers ?? [])
|
|
||||||
.flatMap(mapConfig);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!window.textsecure.messaging) {
|
if (!window.textsecure.messaging) {
|
||||||
|
|
|
@ -626,7 +626,7 @@ const URL_CALLS = {
|
||||||
discovery: 'v1/discovery',
|
discovery: 'v1/discovery',
|
||||||
getGroupAvatarUpload: 'v1/groups/avatar/form',
|
getGroupAvatarUpload: 'v1/groups/avatar/form',
|
||||||
getGroupCredentials: 'v1/certificate/auth/group',
|
getGroupCredentials: 'v1/certificate/auth/group',
|
||||||
getIceServers: 'v1/calling/relays',
|
getIceServers: 'v2/calling/relays',
|
||||||
getOnboardingStoryManifest:
|
getOnboardingStoryManifest:
|
||||||
'dynamic/desktop/stories/onboarding/manifest.json',
|
'dynamic/desktop/stories/onboarding/manifest.json',
|
||||||
getStickerPackUpload: 'v1/sticker/pack/form',
|
getStickerPackUpload: 'v1/sticker/pack/form',
|
||||||
|
@ -902,12 +902,7 @@ export type GetAccountForUsernameResultType = z.infer<
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export type GetIceServersResultType = Readonly<{
|
export type GetIceServersResultType = Readonly<{
|
||||||
username?: string;
|
relays?: ReadonlyArray<IceServerGroupType>;
|
||||||
password?: string;
|
|
||||||
urls?: ReadonlyArray<string>;
|
|
||||||
urlsWithIps?: ReadonlyArray<string>;
|
|
||||||
hostname?: string;
|
|
||||||
iceServers?: ReadonlyArray<IceServerGroupType>;
|
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
export type IceServerGroupType = Readonly<{
|
export type IceServerGroupType = Readonly<{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue