Bugfix: make change_message_uid to update messagelist's filename
This broke code that relied on the filename being up to date in memory after messages are copied. Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:
parent
697ca8a229
commit
0c4fe6bada
@ -356,10 +356,12 @@ class MaildirFolder(BaseFolder):
|
|||||||
oldfilename = self.messagelist[uid]['filename']
|
oldfilename = self.messagelist[uid]['filename']
|
||||||
dir_prefix, filename = os.path.split(oldfilename)
|
dir_prefix, filename = os.path.split(oldfilename)
|
||||||
flags = self.getmessageflags(uid)
|
flags = self.getmessageflags(uid)
|
||||||
filename = self.__new_message_filename(new_uid, flags)
|
newfilename = os.path.join(dir_prefix,
|
||||||
|
self.__new_message_filename(new_uid, flags))
|
||||||
os.rename(os.path.join(self.getfullname(), oldfilename),
|
os.rename(os.path.join(self.getfullname(), oldfilename),
|
||||||
os.path.join(self.getfullname(), dir_prefix, filename))
|
os.path.join(self.getfullname(), newfilename))
|
||||||
self.messagelist[new_uid] = self.messagelist[uid]
|
self.messagelist[new_uid] = self.messagelist[uid]
|
||||||
|
self.messagelist[new_uid]['filename'] = newfilename
|
||||||
del self.messagelist[uid]
|
del self.messagelist[uid]
|
||||||
|
|
||||||
# Interface from BaseFolder
|
# Interface from BaseFolder
|
||||||
|
Loading…
Reference in New Issue
Block a user