From 041003d937e4d3fee4f3d9b2486e4e4be64a8f52 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Thu, 27 Jul 2000 06:39:41 +0000 Subject: Enqueue(): Watch for the _dirty flag in the msgdata dictionary. This forces a write of the message text back to disk, even if it already exists. This is used when the message has been changed (e.g. new or changed header, etc.). --- Mailman/Message.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Mailman/Message.py b/Mailman/Message.py index e45c1722d..c973d8859 100644 --- a/Mailman/Message.py +++ b/Mailman/Message.py @@ -166,7 +166,9 @@ class Message(rfc822.Message): msgdata.update(newdata) msgdata.update(kws) # Get rid of volatile entries, which have the convention of starting - # with an underscore (TBD: should we use v_ as a naming convention?) + # with an underscore (TBD: should we use v_ as a naming convention?). + # Need the _dirty flag for later though. + dirty = msgdata.get('_dirty') for k in msgdata.keys(): if k[0] == '_': del msgdata[k] @@ -174,8 +176,9 @@ class Message(rfc822.Message): dbfp = Utils.open_ex(dbfile, 'w') marshal.dump(msgdata, dbfp) dbfp.close() - # if it doesn't already exist, write the message file - if not existsp: + # If it doesn't already exist, or if the text of the message has + # changed, write the message file to disk. + if not existsp or dirty: msgfp = Utils.open_ex(msgfile, 'w') msgfp.write(text) msgfp.close() -- cgit v1.2.3-70-g09d2