only forceSave when we are creating a new message
This commit is contained in:
parent
75d5e81013
commit
27b7060d09
1 changed files with 5 additions and 1 deletions
|
@ -3310,6 +3310,8 @@ export class ConversationModel extends window.Backbone
|
||||||
callHistoryDetails: detailsToSave,
|
callHistoryDetails: detailsToSave,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Force save if we're adding a new call history message for a direct call
|
||||||
|
let forceSave = true;
|
||||||
if (callHistoryDetails.callMode === CallMode.Direct) {
|
if (callHistoryDetails.callMode === CallMode.Direct) {
|
||||||
const messageId =
|
const messageId =
|
||||||
await window.Signal.Data.getCallHistoryMessageByCallId(
|
await window.Signal.Data.getCallHistoryMessageByCallId(
|
||||||
|
@ -3321,6 +3323,8 @@ export class ConversationModel extends window.Backbone
|
||||||
`addCallHistory: Found existing call history message (Call ID: ${callHistoryDetails.callId}, Message ID: ${messageId})`
|
`addCallHistory: Found existing call history message (Call ID: ${callHistoryDetails.callId}, Message ID: ${messageId})`
|
||||||
);
|
);
|
||||||
message.id = messageId;
|
message.id = messageId;
|
||||||
|
// We don't want to force save if we're updating an existing message
|
||||||
|
forceSave = false;
|
||||||
} else {
|
} else {
|
||||||
log.info(
|
log.info(
|
||||||
`addCallHistory: No existing call history message found (Call ID: ${callHistoryDetails.callId})`
|
`addCallHistory: No existing call history message found (Call ID: ${callHistoryDetails.callId})`
|
||||||
|
@ -3330,7 +3334,7 @@ export class ConversationModel extends window.Backbone
|
||||||
|
|
||||||
const id = await window.Signal.Data.saveMessage(message, {
|
const id = await window.Signal.Data.saveMessage(message, {
|
||||||
ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(),
|
ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(),
|
||||||
forceSave: true,
|
forceSave,
|
||||||
});
|
});
|
||||||
|
|
||||||
log.info(`addCallHistory: Saved call history message (ID: ${id})`);
|
log.info(`addCallHistory: Saved call history message (ID: ${id})`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue