Communicate syncmode to synchooks
This patch sets the environment variable OFFLINEIMAPSYNCMODE to either full, quick or idle depending on the context of the pre- and postsynchook. Adding the context as an argument was considered but this would break existing configurations and it makes calling a program directly more cumbersome. Some programs (e.g. imapfilter) may not know what to do with this extra argument. Signed-off-by: Mart Lubbers <mart@martlubbers.net>
This commit is contained in:
@ -832,10 +832,10 @@ class IdleThread:
|
||||
remotefolder = remoterepos.getfolder(self.folder, decode=False)
|
||||
|
||||
hook = account.getconf('presynchook', '')
|
||||
account.callhook(hook)
|
||||
account.callhook(hook, "idle")
|
||||
offlineimap.accounts.syncfolder(account, remotefolder, quick=False)
|
||||
hook = account.getconf('postsynchook', '')
|
||||
account.callhook(hook)
|
||||
account.callhook(hook, "idle")
|
||||
|
||||
ui = getglobalui()
|
||||
ui.unregisterthread(currentThread()) # syncfolder registered the thread
|
||||
|
Reference in New Issue
Block a user