Handle calls without callId in backup proto
This commit is contained in:
parent
a9ac3897d0
commit
2e886235fa
1 changed files with 14 additions and 6 deletions
|
@ -2141,15 +2141,19 @@ export class BackupImportStream extends Writable {
|
||||||
? this.recipientIdToConvo.get(startedCallRecipientId)
|
? this.recipientIdToConvo.get(startedCallRecipientId)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
if (!callIdLong) {
|
let callId: string;
|
||||||
throw new Error('groupCall: callId is required!');
|
if (callIdLong) {
|
||||||
|
callId = callIdLong.toString();
|
||||||
|
} else {
|
||||||
|
// Legacy calls may not have a callId, so we generate one locally
|
||||||
|
callId = generateUuid();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!startedCallTimestamp) {
|
if (!startedCallTimestamp) {
|
||||||
throw new Error('groupCall: startedCallTimestamp is required!');
|
throw new Error('groupCall: startedCallTimestamp is required!');
|
||||||
}
|
}
|
||||||
const isRingerMe = ringer?.serviceId === aboutMe.aci;
|
const isRingerMe = ringer?.serviceId === aboutMe.aci;
|
||||||
|
|
||||||
const callId = callIdLong.toString();
|
|
||||||
const callHistory: CallHistoryDetails = {
|
const callHistory: CallHistoryDetails = {
|
||||||
callId,
|
callId,
|
||||||
status: fromGroupCallStateProto(state),
|
status: fromGroupCallStateProto(state),
|
||||||
|
@ -2189,9 +2193,14 @@ export class BackupImportStream extends Writable {
|
||||||
read,
|
read,
|
||||||
} = updateMessage.individualCall;
|
} = updateMessage.individualCall;
|
||||||
|
|
||||||
if (!callIdLong) {
|
let callId: string;
|
||||||
throw new Error('individualCall: callId is required!');
|
if (callIdLong) {
|
||||||
|
callId = callIdLong.toString();
|
||||||
|
} else {
|
||||||
|
// Legacy calls may not have a callId, so we generate one locally
|
||||||
|
callId = generateUuid();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!startedCallTimestamp) {
|
if (!startedCallTimestamp) {
|
||||||
throw new Error('individualCall: startedCallTimestamp is required!');
|
throw new Error('individualCall: startedCallTimestamp is required!');
|
||||||
}
|
}
|
||||||
|
@ -2199,7 +2208,6 @@ export class BackupImportStream extends Writable {
|
||||||
const peerId = conversation.serviceId || conversation.e164;
|
const peerId = conversation.serviceId || conversation.e164;
|
||||||
strictAssert(peerId, 'individualCall: no peerId found for call');
|
strictAssert(peerId, 'individualCall: no peerId found for call');
|
||||||
|
|
||||||
const callId = callIdLong.toString();
|
|
||||||
const direction = fromIndividualCallDirectionProto(protoDirection);
|
const direction = fromIndividualCallDirectionProto(protoDirection);
|
||||||
const ringerId =
|
const ringerId =
|
||||||
direction === CallDirection.Outgoing
|
direction === CallDirection.Outgoing
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue