Merge pull request #531 from sachaaaaa/remove_all_private_conv

[multi-device] Remove private convs only
pull/541/head
sachaaaaa 6 years ago committed by GitHub
commit 634d274ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -116,6 +116,7 @@ module.exports = {
getAllPrivateConversations, getAllPrivateConversations,
getAllGroupsInvolvingId, getAllGroupsInvolvingId,
removeAllConversations, removeAllConversations,
removeAllPrivateConversations,
searchConversations, searchConversations,
searchMessages, searchMessages,
@ -2665,6 +2666,10 @@ async function removeAllConversations() {
await removeAllFromTable(CONVERSATIONS_TABLE); await removeAllFromTable(CONVERSATIONS_TABLE);
} }
async function removeAllPrivateConversations() {
await db.run(`DELETE FROM ${CONVERSATIONS_TABLE} WHERE type = 'private'`);
}
async function getMessagesNeedingUpgrade(limit, { maxVersion }) { async function getMessagesNeedingUpgrade(limit, { maxVersion }) {
const rows = await db.all( const rows = await db.all(
`SELECT json FROM messages `SELECT json FROM messages

@ -189,6 +189,7 @@ module.exports = {
removeAll, removeAll,
removeAllConfiguration, removeAllConfiguration,
removeAllConversations, removeAllConversations,
removeAllPrivateConversations,
removeOtherData, removeOtherData,
cleanupOrphanedAttachments, cleanupOrphanedAttachments,
@ -1190,6 +1191,10 @@ async function removeAllConversations() {
await channels.removeAllConversations(); await channels.removeAllConversations();
} }
async function removeAllPrivateConversations() {
await channels.removeAllPrivateConversations();
}
async function cleanupOrphanedAttachments() { async function cleanupOrphanedAttachments() {
await callChannel(CLEANUP_ORPHANED_ATTACHMENTS_KEY); await callChannel(CLEANUP_ORPHANED_ATTACHMENTS_KEY);
} }

@ -145,7 +145,7 @@
}, },
async resetRegistration() { async resetRegistration() {
await window.Signal.Data.removeAllIdentityKeys(); await window.Signal.Data.removeAllIdentityKeys();
await window.Signal.Data.removeAllConversations(); await window.Signal.Data.removeAllPrivateConversations();
Whisper.Registration.remove(); Whisper.Registration.remove();
// Do not remove all items since they are only set // Do not remove all items since they are only set
// at startup. // at startup.

Loading…
Cancel
Save