fix: delete messages on group delete (after leaveMsg sent)

pull/3281/head
Audric Ackermann 5 months ago
parent 17deaf42c0
commit aa8c8a2ad8
No known key found for this signature in database

@ -293,9 +293,10 @@ class ConvoController {
// this is caught and is adding an interaction notification message
throw new Error('Failed to send our leaving message to 03 group');
}
}
// now that we know we've sent the leave message, delete any remaining messages
await this.deleteConvoInitialChecks(groupPk, 'Group', false);
}
// a group 03 can be removed fully or kept empty as kicked.
// when it was pendingInvite, we delete it fully,
@ -330,6 +331,15 @@ class ConvoController {
}
}
} else {
// Let's check if we still have a MetaGroupWrapper for this group. If we don't we won't be able to do anything..
let metaGroupWrapperExists = false;
try {
await MetaGroupWrapperActions.infoGet(groupPk);
metaGroupWrapperExists = true;
} catch {
window.log.warn(`deleteGroup: MetaGroupWrapperActions for ${groupPk} does not exist.`);
}
if (metaGroupWrapperExists) {
try {
const us = UserUtils.getOurPubKeyStrFromCache();
const allMembers = await MetaGroupWrapperActions.memberGetAll(groupPk);
@ -374,6 +384,7 @@ class ConvoController {
);
throw e;
}
}
// this deletes the secretKey if we had it. If we need it for something, it has to be done before this call.
await UserGroupsWrapperActions.eraseGroup(groupPk);

Loading…
Cancel
Save