New option to only work with subscribed folders

Patch from Sean Finney, slightly modified by John Goerzen to change
name of config file option

fixes deb#499588
This commit is contained in:
John Goerzen
2008-10-01 00:33:57 -05:00
parent 936fe1f43e
commit d69176090c
2 changed files with 10 additions and 1 deletions

View File

@ -192,8 +192,13 @@ class IMAPRepository(BaseRepository):
return self.folders
retval = []
imapobj = self.imapserver.acquireconnection()
# check whether to list all folders, or subscribed only
listfunction = imapobj.list
if self.config.has_option(self.getsection(), 'subscribedonly'):
if self.getconf('subscribedonly') == "yes":
listfunction = imapobj.lsub
try:
listresult = imapobj.list(directory = self.imapserver.reference)[1]
listresult = listfunction(directory = self.imapserver.reference)[1]
finally:
self.imapserver.releaseconnection(imapobj)
for string in listresult: