delete and reset device-messages on import; this avoids wrong information in the device chat and allows adding correct information again

This commit is contained in:
B. Petersen
2019-12-22 01:52:36 +01:00
committed by holger krekel
parent ce15ef2db9
commit 521a854635
2 changed files with 19 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ use rand::{thread_rng, Rng};
use crate::blob::BlobObject;
use crate::chat;
use crate::chat::delete_and_reset_all_device_msgs;
use crate::config::Config;
use crate::configure::*;
use crate::constants::*;
@@ -441,6 +442,8 @@ fn import_backup(context: &Context, backup_to_import: impl AsRef<Path>) -> Resul
"could not re-open db"
);
delete_and_reset_all_device_msgs(&context)?;
let total_files_cnt = context
.sql
.query_get_value::<_, isize>(context, "SELECT COUNT(*) FROM backup_blobs;", params![])