summaryrefslogtreecommitdiff
path: root/Mailman/database/message.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-12-10 23:00:14 -0500
committerBarry Warsaw2007-12-10 23:00:14 -0500
commit7923b90f0349f9e2dc891082e2e1c3bf23b4d79c (patch)
tree35ce2b0d149f8f806d84e0b8e991213d073df193 /Mailman/database/message.py
parent5495accf05d77e1c4ff2855f5e42c2e56f51e45d (diff)
downloadmailman-7923b90f0349f9e2dc891082e2e1c3bf23b4d79c.tar.gz
mailman-7923b90f0349f9e2dc891082e2e1c3bf23b4d79c.tar.zst
mailman-7923b90f0349f9e2dc891082e2e1c3bf23b4d79c.zip
Add .get() to our Message subclass, which ensures that returned
values are unicodes if they come from the base class as a string. Get rid of the 'global id'. Now use just Message-ID. Rename X-List-ID-Hash to X-Message-ID-Hash. Do not take Date header into account when calculating this hash. Because of the above change, the assumption is that there will be no Message-ID collisions. Therefore, get rid of IMessageStore .get_message(), .get_messages_by_message_id() and .get_messages_by_hash(). Instead, it's now .get_message_by_id() and .get_message_by_hash() both of which return the message object or None. Message.hash -> Message.message_id_hash When storing a message in the message store, the final path component has the entire hash, not just the leftover parts after directory prefix splitting. MessageStore.delete_message() deletes the file too. Doctests clean up message store messages though the message store instead of directly off the filesystem.
Diffstat (limited to 'Mailman/database/message.py')
-rw-r--r--Mailman/database/message.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Mailman/database/message.py b/Mailman/database/message.py
index b8a7e3dfb..01e71b0c0 100644
--- a/Mailman/database/message.py
+++ b/Mailman/database/message.py
@@ -31,12 +31,12 @@ class Message(Model):
id = Int(primary=True, default=AutoReload)
message_id = Unicode()
- hash = RawStr()
+ message_id_hash = RawStr()
path = RawStr()
# This is a Messge-ID field representation, not a database row id.
- def __init__(self, message_id, hash, path):
+ def __init__(self, message_id, message_id_hash, path):
self.message_id = message_id
- self.hash = hash
+ self.message_id_hash = message_id_hash
self.path = path
config.db.store.add(self)