Improve handling of DOE sync messages for stories
This commit is contained in:
parent
9d8ad21819
commit
d1b505d580
3 changed files with 40 additions and 10 deletions
|
@ -5,18 +5,27 @@ import type { DeleteModel } from '../messageModifiers/Deletes';
|
|||
import type { MessageModel } from '../models/messages';
|
||||
import * as log from '../logging/log';
|
||||
import { DAY } from './durations';
|
||||
import { isMe } from './whatTypeOfConversation';
|
||||
import { getContactId } from '../messages/helpers';
|
||||
import { isStory } from '../state/selectors/message';
|
||||
|
||||
export async function deleteForEveryone(
|
||||
message: MessageModel,
|
||||
doe: DeleteModel,
|
||||
shouldPersist = true
|
||||
): Promise<void> {
|
||||
if (message.deletingForEveryone || message.get('deletedForEveryone')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isDeletionByMe(message, doe)) {
|
||||
const conversation = message.getConversation();
|
||||
|
||||
// Our 1:1 stories are deleted through ts/util/onStoryRecipientUpdate.ts
|
||||
if (
|
||||
isStory(message.attributes) &&
|
||||
conversation &&
|
||||
isMe(conversation.attributes)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
await message.handleDeleteForEveryone(doe, shouldPersist);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue