Prevent modifications on a folder level to occur in dry-run

Prevent savemessage(), and savemessageflags() to occur in dryrun mode in
all backends. Still need to protect against deletemessage().

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2011-09-16 11:44:50 +02:00
parent b6807355b5
commit 5ef69e95c0
7 changed files with 81 additions and 7 deletions

View File

@ -184,7 +184,12 @@ class MappedIMAPFolder(IMAPFolder):
If the uid is > 0, the backend should set the uid to this, if it can.
If it cannot set the uid to that, it will save it anyway.
It will return the uid assigned in any case.
See folder/Base for details. Note that savemessage() does not
check against dryrun settings, so you need to ensure that
savemessage is never called in a dryrun mode.
"""
self.ui.savemessage('imap', uid, flags, self)
# Mapped UID instances require the source to already have a
# positive UID, so simply return here.
if uid < 0:
@ -217,6 +222,11 @@ class MappedIMAPFolder(IMAPFolder):
return None
def savemessageflags(self, uid, flags):
"""
Note that this function does not check against dryrun settings,
so you need to ensure that it is never called in a
dryrun mode."""
self._mb.savemessageflags(self.r2l[uid], flags)
def addmessageflags(self, uid, flags):