Fix hooks for IDLE sync

`presynchook` and `postsynchook` for IDLE-triggered syncs were broken by
da69fd8. This fixes them.

Signed-off-by: Reto Schnyder <reto.a.schnyder@bluewin.ch>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Reto Schnyder 2020-08-10 19:38:58 +02:00 committed by Nicolas Sebrecht
parent 21332efb08
commit f6935342c2
1 changed files with 5 additions and 4 deletions

View File

@ -823,11 +823,12 @@ class IdleThread(object):
statusrepos = account.statusrepos
remotefolder = remoterepos.getfolder(self.folder, decode=False)
hook = account.getconf('presynchook', '')
account.callhook(hook)
hook_env = {
'OIMAP_ACCOUNT_NAME': account.getname(),
}
account.callhook('presynchook', hook_env)
offlineimap.accounts.syncfolder(account, remotefolder, quick=False)
hook = account.getconf('postsynchook', '')
account.callhook(hook)
account.callhook('postsynchook', hook_env)
ui = getglobalui()
ui.unregisterthread(currentThread()) #syncfolder registered the thread