/head: changeset 114

Added workaround for UW IMAPd
This commit is contained in:
jgoerzen 2002-07-12 12:46:36 +01:00
parent 53625f0dbb
commit 1c14751a74

View File

@ -164,25 +164,38 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos,
localfolder = localrepos.\ localfolder = localrepos.\
getfolder(remotefolder.getvisiblename().\ getfolder(remotefolder.getvisiblename().\
replace(remoterepos.getsep(), localrepos.getsep())) replace(remoterepos.getsep(), localrepos.getsep()))
if not localfolder.isuidvalidityok(remotefolder): # Load local folder
ui.validityproblem(remotefolder)
return
ui.syncingfolder(remoterepos, remotefolder, localrepos, localfolder) ui.syncingfolder(remoterepos, remotefolder, localrepos, localfolder)
ui.loadmessagelist(localrepos, localfolder) ui.loadmessagelist(localrepos, localfolder)
localfolder.cachemessagelist() localfolder.cachemessagelist()
ui.messagelistloaded(localrepos, localfolder, len(localfolder.getmessagelist().keys())) ui.messagelistloaded(localrepos, localfolder, len(localfolder.getmessagelist().keys()))
# Load status folder.
statusfolder = statusrepos.getfolder(remotefolder.getvisiblename().\
replace(remoterepos.getsep(),
statusrepos.getsep()))
statusfolder.cachemessagelist()
# If either the local or the status folder has messages and
# there is a UID validity problem, warn and abort.
# If there are no messages, UW IMAPd loses UIDVALIDITY.
# But we don't really need it if both local folders are empty.
# So, in that case, save it off.
if (len(localfolder.getmessagelist()) or \
len(statusfolder.getmessagelist())) and \
not localfolder.isuidvalidityok(remotefolder):
ui.validityproblem(remotefolder)
return
else:
localfolder.saveuidvalidity(remotefolder.getuidvalidity())
# Load remote folder. # Load remote folder.
ui.loadmessagelist(remoterepos, remotefolder) ui.loadmessagelist(remoterepos, remotefolder)
remotefolder.cachemessagelist() remotefolder.cachemessagelist()
ui.messagelistloaded(remoterepos, remotefolder, ui.messagelistloaded(remoterepos, remotefolder,
len(remotefolder.getmessagelist().keys())) len(remotefolder.getmessagelist().keys()))
# Load status folder.
statusfolder = statusrepos.getfolder(remotefolder.getvisiblename().\
replace(remoterepos.getsep(),
statusrepos.getsep()))
statusfolder.cachemessagelist()
# #