Fix getuidvalidity crash (UIDVALIDITY returning None)
Rename getuidvalidity -> get_uidvalidity and cache the IMAP result. 1) Start modernizing our function names using more underscores 2) IMAPs implementation of get_uidvalidity was removing the UIDVALIDITY result from the imaplib2 result stack, so subsequent calls would return "None". As various functions can invoke this, this led to some errors that we avoid by caching the current UIDVALIDITY value in the Folder instance. There are more simplifications and improvements to be made. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
@ -378,7 +378,7 @@ def syncfolder(account, remotefolder, quick):
|
||||
statusfolder = statusrepos.getfolder(remotefolder.getvisiblename().\
|
||||
replace(remoterepos.getsep(),
|
||||
statusrepos.getsep()))
|
||||
if localfolder.getuidvalidity() == None:
|
||||
if localfolder.get_uidvalidity() == None:
|
||||
# This is a new folder, so delete the status cache to be sure
|
||||
# we don't have a conflict.
|
||||
statusfolder.deletemessagelist()
|
||||
|
Reference in New Issue
Block a user