Save modified messages for edits

This commit is contained in:
Josh Perez 2023-10-17 15:30:41 -04:00 committed by GitHub
parent 156cbca1a3
commit 6c88c7c587
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 9 deletions

View file

@ -2367,7 +2367,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
return modifyTargetMessage(this, conversation, {
isFirstRun,
skipEdits: false,
skipSave: false,
});
}

View file

@ -342,7 +342,6 @@ export async function handleEditMessage(
await modifyTargetMessage(mainMessageModel, mainMessageConversation, {
isFirstRun: false,
skipEdits: true,
skipSave: true,
});
}

View file

@ -35,13 +35,9 @@ import { strictAssert } from './assert';
export async function modifyTargetMessage(
message: MessageModel,
conversation: ConversationModel,
options?: { isFirstRun: boolean; skipEdits: boolean; skipSave: boolean }
options?: { isFirstRun: boolean; skipEdits: boolean }
): Promise<void> {
const {
isFirstRun = false,
skipEdits = false,
skipSave = false,
} = options ?? {};
const { isFirstRun = false, skipEdits = false } = options ?? {};
const logId = `modifyTargetMessage/${message.idForLogging()}`;
const type = message.get('type');
@ -267,7 +263,7 @@ export async function modifyTargetMessage(
);
}
if (!skipSave && changed && !isFirstRun) {
if (changed && !isFirstRun) {
log.info(`${logId}: Changes in second run; saving.`);
await window.Signal.Data.saveMessage(message.attributes, {
ourAci,