From 2f015863ca7c774ef87e43887755089c75574ede Mon Sep 17 00:00:00 2001 From: Jim Gustafson Date: Wed, 29 Jul 2020 09:29:57 -0700 Subject: [PATCH] Upgrade to RingRTC v2.4.0 --- package.json | 2 +- protos/SignalService.proto | 26 +++++++++++++++++--------- ts/model-types.d.ts | 2 +- ts/services/calling.ts | 2 +- ts/textsecure.d.ts | 6 +++++- yarn.lock | 6 +++--- 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index c6739d5f3183..bd95375bed6d 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "redux-ts-utils": "3.2.2", "reselect": "4.0.0", "rimraf": "2.6.2", - "ringrtc": "https://github.com/signalapp/signal-ringrtc-node.git#29a00a1e63697026313fa819f20276c47d0afdc5", + "ringrtc": "https://github.com/signalapp/signal-ringrtc-node.git#f418f32a6616ea999c026161793bf44aa91c66f1", "sanitize-filename": "1.6.3", "sanitize.css": "11.0.0", "semver": "5.4.1", diff --git a/protos/SignalService.proto b/protos/SignalService.proto index 1bc3abc60f7c..44a46ca71c3d 100644 --- a/protos/SignalService.proto +++ b/protos/SignalService.proto @@ -40,25 +40,33 @@ message Content { message CallingMessage { message Offer { enum Type { - OFFER_AUDIO_CALL = 0; - OFFER_VIDEO_CALL = 1; + OFFER_AUDIO_CALL = 0; + OFFER_VIDEO_CALL = 1; } optional uint64 callId = 1; + // Legacy/deprecated; replaced by 'opaque' optional string sdp = 2; - optional Type type = 3; + optional Type type = 3; + optional bytes opaque = 4; } message Answer { - optional uint64 callId = 1; - optional string sdp = 2; + optional uint64 callId = 1; + // Legacy/deprecated; replaced by 'opaque' + optional string sdp = 2; + optional bytes opaque = 3; } message IceCandidate { - optional uint64 callId = 1; - optional string mid = 2; - optional uint32 midIndex = 3; - optional string sdp = 4; + optional uint64 callId = 1; + // Legacy/deprecated; remove when old clients are gone. + optional string mid = 2; + // Legacy/deprecated; remove when old clients are gone. + optional uint32 line = 3; + // Legacy/deprecated; replaced by 'opaque' + optional string sdp = 4; + optional bytes opaque = 5; } message Busy { diff --git a/ts/model-types.d.ts b/ts/model-types.d.ts index 17a8524ae343..4161c6f2d097 100644 --- a/ts/model-types.d.ts +++ b/ts/model-types.d.ts @@ -87,7 +87,6 @@ declare class ConversationModelType extends Backbone.Model< getAccepted(): boolean; getAvatarPath(): string | undefined; getColor(): ColorType | undefined; - getIsAddedByContact(): boolean; getName(): string | undefined; getNumber(): string; getProfileName(): string | undefined; @@ -96,6 +95,7 @@ declare class ConversationModelType extends Backbone.Model< getSendOptions(options?: any): SendOptionsType | undefined; getTitle(): string; idForLogging(): string; + isFromOrAddedByTrustedContact(): boolean; isVerified(): boolean; safeGetVerified(): Promise; setProfileKey(profileKey?: string | null): Promise; diff --git a/ts/services/calling.ts b/ts/services/calling.ts index 9fbda8f709ea..52dc8ce3b8fb 100644 --- a/ts/services/calling.ts +++ b/ts/services/calling.ts @@ -396,7 +396,7 @@ export class CallingClass { const shouldRelayCalls = Boolean(await window.getAlwaysRelayCalls()); // If the peer is 'unknown', i.e. not in the contact list, force IP hiding. - const isContactUnknown = !conversation.getIsAddedByContact(); + const isContactUnknown = !conversation.isFromOrAddedByTrustedContact(); return { iceServer: JSON.parse(iceServerJson), diff --git a/ts/textsecure.d.ts b/ts/textsecure.d.ts index 123b8ce1ee9c..8357fd1fe39f 100644 --- a/ts/textsecure.d.ts +++ b/ts/textsecure.d.ts @@ -904,6 +904,9 @@ export declare class WebSocketResponseMessageClass { // Everything from here down to HangupType (everything related to calling) // must be kept in sync with RingRTC (ringrtc-node). // Whenever you change this, make sure you change RingRTC as well. + +type ProtobufArrayBuffer = ArrayBuffer | { toArrayBuffer: () => ArrayBuffer }; + export type DeviceId = number; export type CallId = any; @@ -938,7 +941,8 @@ export class AnswerMessageClass { export class IceCandidateMessageClass { callId?: CallId; mid?: string; - midIndex?: number; + line?: number; + opaque?: ProtobufArrayBuffer; sdp?: string; } diff --git a/yarn.lock b/yarn.lock index 708b983f9b25..abdb0237aaa1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14929,9 +14929,9 @@ rimraf@~2.4.0: dependencies: glob "^6.0.1" -"ringrtc@https://github.com/signalapp/signal-ringrtc-node.git#29a00a1e63697026313fa819f20276c47d0afdc5": - version "2.3.1" - resolved "https://github.com/signalapp/signal-ringrtc-node.git#29a00a1e63697026313fa819f20276c47d0afdc5" +"ringrtc@https://github.com/signalapp/signal-ringrtc-node.git#f418f32a6616ea999c026161793bf44aa91c66f1": + version "2.4.0" + resolved "https://github.com/signalapp/signal-ringrtc-node.git#f418f32a6616ea999c026161793bf44aa91c66f1" ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.1"