Make sure RingRTC has our UUID

This commit is contained in:
Evan Hahn 2021-09-07 11:21:17 -05:00 committed by GitHub
parent bae84b6b67
commit cc52a94c76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -215,8 +215,6 @@ export class CallingClass {
private hadLocalVideoBeforePresenting?: boolean;
private hasGivenOurUuidToRingRtc = false;
constructor() {
this.videoCapturer = new GumVideoCapturer({
maxWidth: REQUESTED_VIDEO_WIDTH,
@ -252,6 +250,9 @@ export class CallingClass {
);
this.attemptToGiveOurUuidToRingRtc();
window.Whisper.events.on('userChanged', () => {
this.attemptToGiveOurUuidToRingRtc();
});
ipcRenderer.on('stop-screen-share', () => {
uxActions.setPresenting();
@ -261,10 +262,6 @@ export class CallingClass {
}
private attemptToGiveOurUuidToRingRtc(): void {
if (this.hasGivenOurUuidToRingRtc) {
return;
}
const ourUuid = window.textsecure.storage.user.getUuid();
if (!ourUuid) {
// This can happen if we're not linked. It's okay if we hit this case.
@ -272,7 +269,6 @@ export class CallingClass {
}
RingRTC.setSelfUuid(Buffer.from(uuidToArrayBuffer(ourUuid)));
this.hasGivenOurUuidToRingRtc = true;
}
async startCallingLobby(
@ -689,8 +685,6 @@ export class CallingClass {
hasLocalVideo: boolean,
shouldRing: boolean
): void {
this.attemptToGiveOurUuidToRingRtc();
const conversation = window.ConversationController.get(
conversationId
)?.format();
@ -980,8 +974,6 @@ export class CallingClass {
declineGroupCall(conversationId: string, ringId: bigint): void {
window.log.info('CallingClass.declineGroupCall()');
this.attemptToGiveOurUuidToRingRtc();
const groupId = window.ConversationController.get(conversationId)?.get(
'groupId'
);
@ -1575,8 +1567,6 @@ export class CallingClass {
data: Buffer,
urgency: CallMessageUrgency
): Promise<void> {
this.attemptToGiveOurUuidToRingRtc();
const groupId = groupIdBytes.toString('base64');
const conversation = window.ConversationController.get(groupId);
if (!conversation) {
@ -1624,8 +1614,6 @@ export class CallingClass {
): Promise<void> {
window.log.info(`handleGroupCallRingUpdate(): got ring update ${update}`);
this.attemptToGiveOurUuidToRingRtc();
const groupId = groupIdBytes.toString('base64');
const ringerUuid = arrayBufferToUuid(typedArrayToArrayBuffer(ringerBytes));