aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2020-09-25 10:32:55 -0300
committerJason Gunthorpe <jgg@nvidia.com>2020-09-25 10:32:55 -0300
commit13db1b030de3b885468d2473dd3d432000b21f31 (patch)
tree4690a158df766e5f9b6796fd4337c3fc580781bf
parent015f0e31e6026190ff9c73608e5db42d1dd7682a (diff)
downloadcloud_mdir_sync-13db1b030de3b885468d2473dd3d432000b21f31.tar.gz
cloud_mdir_sync-13db1b030de3b885468d2473dd3d432000b21f31.tar.bz2
cloud_mdir_sync-13db1b030de3b885468d2473dd3d432000b21f31.zip
Do not immediately restore deleted items
When not using the deleted maildir flag messages would be restored immediately after the cloud was updated. This is because nmsgs was updated in the wrong order. Fixes: 131d182e0054 ("Add a --offline option") Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
-rw-r--r--cloud_mdir_sync/main.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/cloud_mdir_sync/main.py b/cloud_mdir_sync/main.py
index 89daa11..db33af8 100644
--- a/cloud_mdir_sync/main.py
+++ b/cloud_mdir_sync/main.py
@@ -74,13 +74,15 @@ async def synchronize_mail(cfg: config.Config):
for mbox in cfg.all_mboxes()
if mbox.need_update))
- nmsgs = route_cloud_messages(cfg)
if msgs is not None:
await update_cloud_from_local(cfg, msgs)
- elif cfg.args.OFFLINE:
- await update_cloud_from_local(cfg,
- nmsgs,
- offline_mode=True)
+ nmsgs = route_cloud_messages(cfg)
+ else:
+ nmsgs = route_cloud_messages(cfg)
+ if cfg.args.OFFLINE:
+ await update_cloud_from_local(cfg,
+ nmsgs,
+ offline_mode=True)
force_local_to_cloud(cfg, nmsgs)
msgs = nmsgs