Use 'reference' value when creating an IMAP directory

A repositories 'reference value is always prefixed to the full folder
path, so we should do so when creating a new one. The code had existed
but was commented out since 2003, I guess the "reference" option is not
too often used.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2011-09-30 16:53:18 +02:00
parent 0ba9634205
commit 9578f29195
2 changed files with 6 additions and 13 deletions

View File

@ -1,6 +1,5 @@
# IMAP folder support
# Copyright (C) 2002-2007 John Goerzen
# <jgoerzen@complete.org>
# Copyright (C) 2002-2011 John Goerzen & contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,5 @@
# IMAP repository support
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.org>
# Copyright (C) 2002-2011 John Goerzen & contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -171,7 +170,7 @@ class IMAPRepository(BaseRepository):
return self.getconf('preauthtunnel', None)
def getreference(self):
return self.getconf('reference', '""')
return self.getconf('reference', '')
def getidlefolders(self):
localeval = self.localeval
@ -316,14 +315,9 @@ class IMAPRepository(BaseRepository):
when you are done creating folders yourself.
:param foldername: Full path of the folder to be created."""
#TODO: IMHO this existing commented out code is correct and
#should be enabled, but this would change the behavior for
#existing configurations who have a 'reference' set on a Mapped
#IMAP server....:
#if self.getreference() != '""':
# newname = self.getreference() + self.getsep() + foldername
#else:
# newname = foldername
if self.getreference():
foldername = self.getreference() + self.getsep() + foldername
imapobj = self.imapserver.acquireconnection()
try:
self.ui._msg("Creating new IMAP folder '%s' on server %s" %\