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

View File

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