Make sure RingRTC has our UUID
This commit is contained in:
parent
bae84b6b67
commit
cc52a94c76
1 changed files with 3 additions and 15 deletions
|
@ -215,8 +215,6 @@ export class CallingClass {
|
||||||
|
|
||||||
private hadLocalVideoBeforePresenting?: boolean;
|
private hadLocalVideoBeforePresenting?: boolean;
|
||||||
|
|
||||||
private hasGivenOurUuidToRingRtc = false;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.videoCapturer = new GumVideoCapturer({
|
this.videoCapturer = new GumVideoCapturer({
|
||||||
maxWidth: REQUESTED_VIDEO_WIDTH,
|
maxWidth: REQUESTED_VIDEO_WIDTH,
|
||||||
|
@ -252,6 +250,9 @@ export class CallingClass {
|
||||||
);
|
);
|
||||||
|
|
||||||
this.attemptToGiveOurUuidToRingRtc();
|
this.attemptToGiveOurUuidToRingRtc();
|
||||||
|
window.Whisper.events.on('userChanged', () => {
|
||||||
|
this.attemptToGiveOurUuidToRingRtc();
|
||||||
|
});
|
||||||
|
|
||||||
ipcRenderer.on('stop-screen-share', () => {
|
ipcRenderer.on('stop-screen-share', () => {
|
||||||
uxActions.setPresenting();
|
uxActions.setPresenting();
|
||||||
|
@ -261,10 +262,6 @@ export class CallingClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
private attemptToGiveOurUuidToRingRtc(): void {
|
private attemptToGiveOurUuidToRingRtc(): void {
|
||||||
if (this.hasGivenOurUuidToRingRtc) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ourUuid = window.textsecure.storage.user.getUuid();
|
const ourUuid = window.textsecure.storage.user.getUuid();
|
||||||
if (!ourUuid) {
|
if (!ourUuid) {
|
||||||
// This can happen if we're not linked. It's okay if we hit this case.
|
// 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)));
|
RingRTC.setSelfUuid(Buffer.from(uuidToArrayBuffer(ourUuid)));
|
||||||
this.hasGivenOurUuidToRingRtc = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async startCallingLobby(
|
async startCallingLobby(
|
||||||
|
@ -689,8 +685,6 @@ export class CallingClass {
|
||||||
hasLocalVideo: boolean,
|
hasLocalVideo: boolean,
|
||||||
shouldRing: boolean
|
shouldRing: boolean
|
||||||
): void {
|
): void {
|
||||||
this.attemptToGiveOurUuidToRingRtc();
|
|
||||||
|
|
||||||
const conversation = window.ConversationController.get(
|
const conversation = window.ConversationController.get(
|
||||||
conversationId
|
conversationId
|
||||||
)?.format();
|
)?.format();
|
||||||
|
@ -980,8 +974,6 @@ export class CallingClass {
|
||||||
declineGroupCall(conversationId: string, ringId: bigint): void {
|
declineGroupCall(conversationId: string, ringId: bigint): void {
|
||||||
window.log.info('CallingClass.declineGroupCall()');
|
window.log.info('CallingClass.declineGroupCall()');
|
||||||
|
|
||||||
this.attemptToGiveOurUuidToRingRtc();
|
|
||||||
|
|
||||||
const groupId = window.ConversationController.get(conversationId)?.get(
|
const groupId = window.ConversationController.get(conversationId)?.get(
|
||||||
'groupId'
|
'groupId'
|
||||||
);
|
);
|
||||||
|
@ -1575,8 +1567,6 @@ export class CallingClass {
|
||||||
data: Buffer,
|
data: Buffer,
|
||||||
urgency: CallMessageUrgency
|
urgency: CallMessageUrgency
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
this.attemptToGiveOurUuidToRingRtc();
|
|
||||||
|
|
||||||
const groupId = groupIdBytes.toString('base64');
|
const groupId = groupIdBytes.toString('base64');
|
||||||
const conversation = window.ConversationController.get(groupId);
|
const conversation = window.ConversationController.get(groupId);
|
||||||
if (!conversation) {
|
if (!conversation) {
|
||||||
|
@ -1624,8 +1614,6 @@ export class CallingClass {
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
window.log.info(`handleGroupCallRingUpdate(): got ring update ${update}`);
|
window.log.info(`handleGroupCallRingUpdate(): got ring update ${update}`);
|
||||||
|
|
||||||
this.attemptToGiveOurUuidToRingRtc();
|
|
||||||
|
|
||||||
const groupId = groupIdBytes.toString('base64');
|
const groupId = groupIdBytes.toString('base64');
|
||||||
|
|
||||||
const ringerUuid = arrayBufferToUuid(typedArrayToArrayBuffer(ringerBytes));
|
const ringerUuid = arrayBufferToUuid(typedArrayToArrayBuffer(ringerBytes));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue