Add more logging to addCallHistory

This commit is contained in:
Jamie Kyle 2023-02-16 09:57:49 -08:00 committed by GitHub
parent 260c1fd9df
commit 85c217e803
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3225,11 +3225,25 @@ export class ConversationModel extends window.Backbone
switch (callHistoryDetails.callMode) {
case CallMode.Direct: {
const {
callId,
wasIncoming,
wasVideoCall,
wasDeclined,
acceptedTime,
endedTime,
} = callHistoryDetails;
log.info(
`addCallHistory: Adding direct call to history (Call ID ${callHistoryDetails.callId})`
`addCallHistory: Call ID: ${callId}, ` +
'Direct, ' +
`Incoming: ${wasIncoming}, ` +
`Video: ${wasVideoCall}, ` +
`Declined: ${wasDeclined}, ` +
`Accepted: ${acceptedTime}, ` +
`Ended: ${endedTime}`
);
const resolvedTime =
callHistoryDetails.acceptedTime ?? callHistoryDetails.endedTime;
const resolvedTime = acceptedTime ?? endedTime;
assertDev(resolvedTime, 'Direct call must have accepted or ended time');
timestamp = resolvedTime;
unread =
@ -3277,6 +3291,10 @@ export class ConversationModel extends window.Backbone
`addCallHistory: Found existing call history message (Call ID ${callHistoryDetails.callId}, Message ID: ${messageId})`
);
message.id = messageId;
} else {
log.info(
`addCallHistory: No existing call history message found (Call ID ${callHistoryDetails.callId})`
);
}
}