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 conversationModelForUIUpdate
); );
// window.log.debug( window.log.debug(
// `WIP:innerHandleSwarmContentMessage: ${ `WIP:innerHandleSwarmContentMessage: ${
// content.dataMessage.syncTarget ? 'This is a sync message.\n' : '' content.dataMessage.syncTarget ? 'This is a sync message.\n' : ''
// } content: ${JSON.stringify(content)} ${ } content: ${JSON.stringify(content)} ${
// expireUpdate ? `\n\nexpireUpdate: ${JSON.stringify(expireUpdate)}` : '' expireUpdate ? `\n\nexpireUpdate: ${JSON.stringify(expireUpdate)}` : ''
// }` }`
// ); );
if (expireUpdate?.isOutdated) { if (expireUpdate?.isOutdated) {
// window.log.debug( window.log.debug(`WIP: ExpireUpdate is outdated. Ignoring it and removing from cache.`);
// `WIP: innerHandleSwarmContentMessage: This ${
// content.dataMessage.syncTarget ? 'sync' : ''
// } message is outdated. Ignoring it.\n\ncontent:${JSON.stringify(
// content
// )}\n\nexpireUpdate: ${JSON.stringify(expireUpdate)}`
// );
await removeFromCache(envelope); await removeFromCache(envelope);
return; return;
} }

@ -392,7 +392,7 @@ export async function handleMessageJob(
try { try {
messageModel.set({ flags: regularDataMessage.flags }); 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 ( if (
conversation && conversation &&
messageModel.get('expireTimer') > 0 && messageModel.get('expireTimer') > 0 &&
@ -413,7 +413,7 @@ export async function handleMessageJob(
// messageModel.get('type') === 'outgoing'; // messageModel.get('type') === 'outgoing';
// TODO legacy messages support will be removed in a future release // 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 // TODO legacy support could be broken after V2 is released on a modern client on a 1-1 with disapearAfterRead
if ( if (
(canBeDeleteAfterSend && expirationMode === 'legacy') || (canBeDeleteAfterSend && expirationMode === 'legacy') ||

Loading…
Cancel
Save