fix: canBeDeleteAftereSend in messagejob was wrong

pull/2971/head
William Grant 2 years ago
parent ec81805745
commit 17f8431f59

@ -484,22 +484,16 @@ export async function innerHandleSwarmContentMessage(
conversationModelForUIUpdate
);
// window.log.debug(
// `WIP:innerHandleSwarmContentMessage: ${
// content.dataMessage.syncTarget ? 'This is a sync message.\n' : ''
// } content: ${JSON.stringify(content)} ${
// expireUpdate ? `\n\nexpireUpdate: ${JSON.stringify(expireUpdate)}` : ''
// }`
// );
window.log.debug(
`WIP:innerHandleSwarmContentMessage: ${
content.dataMessage.syncTarget ? 'This is a sync message.\n' : ''
} content: ${JSON.stringify(content)} ${
expireUpdate ? `\n\nexpireUpdate: ${JSON.stringify(expireUpdate)}` : ''
}`
);
if (expireUpdate?.isOutdated) {
// window.log.debug(
// `WIP: innerHandleSwarmContentMessage: This ${
// content.dataMessage.syncTarget ? 'sync' : ''
// } message is outdated. Ignoring it.\n\ncontent:${JSON.stringify(
// content
// )}\n\nexpireUpdate: ${JSON.stringify(expireUpdate)}`
// );
window.log.debug(`WIP: ExpireUpdate is outdated. Ignoring it and removing from cache.`);
await removeFromCache(envelope);
return;
}

@ -392,7 +392,7 @@ export async function handleMessageJob(
try {
messageModel.set({ flags: regularDataMessage.flags });
// NOTE we handle incoming disappear afer send messages and sync messages here
// NOTE we handle incoming disappear after send messages and sync messages here
if (
conversation &&
messageModel.get('expireTimer') > 0 &&
@ -413,7 +413,7 @@ export async function handleMessageJob(
// messageModel.get('type') === 'outgoing';
// TODO legacy messages support will be removed in a future release
const canBeDeleteAfterSend = conversation && conversation.isMe() && conversation.isGroup();
const canBeDeleteAfterSend = conversation && (conversation.isMe() || conversation.isGroup());
// TODO legacy support could be broken after V2 is released on a modern client on a 1-1 with disapearAfterRead
if (
(canBeDeleteAfterSend && expirationMode === 'legacy') ||

Loading…
Cancel
Save