Fixed In-Reply-To bug (b7c)
authorDmitriy Morozov <morozov@cs.duke.edu>
Sun, 06 Jan 2008 01:06:52 -0500
changeset 13 e155f2129514
parent 12 3336e2f6fdef
child 14 e78a97664dba
Fixed In-Reply-To bug (b7c)
.issues/b7cdd0ec985471b7
artemis.py
--- a/.issues/b7cdd0ec985471b7	Sun Jan 06 00:59:21 2008 -0500
+++ b/.issues/b7cdd0ec985471b7	Sun Jan 06 01:06:52 2008 -0500
@@ -1,7 +1,7 @@
 From artemis Fri Jan  4 18:24:46 2008
 From: Dmitriy Morozov <morozov@cs.duke.edu>
 Date: Fri, 04 Jan 2008 13:16:44 EST
-State: new
+State: fixed
 Subject: Thread messages by In-Reply-To
 Message-Id: <b7cdd0ec985471b7-0-artemis@metatron>
 
@@ -9,3 +9,13 @@
 there is only one element there. It should thread messages by
 In-Reply-To header (and set it accordingly), and either ignore
 References, or set it be equal to In-Reply-To.
+
+From artemis Sun Jan  6 06:04:32 2008
+From: Dmitriy Morozov <morozov@cs.duke.edu>
+Date: Sun, 06 Jan 2008 01:04:32 EST
+Subject: properties changes (state)
+Message-Id: <b7cdd0ec985471b7-f5b5087bf1c336ab-artemis@metatron>
+References: <b7cdd0ec985471b7-0-artemis@metatron>
+In-Reply-To: <b7cdd0ec985471b7-0-artemis@metatron>
+
+state=fixed
--- a/artemis.py	Sun Jan 06 00:59:21 2008 -0500
+++ b/artemis.py	Sun Jan 06 01:06:52 2008 -0500
@@ -109,6 +109,7 @@
 	else:
 		msg.add_header('Message-Id', "<%s-%s-artemis@%s>" % (issue_id, _random_id(), socket.gethostname()))
 		msg.add_header('References', mbox[(comment < len(mbox) and comment) or 0]['Message-Id'])
+		msg.add_header('In-Reply-To', mbox[(comment < len(mbox) and comment) or 0]['Message-Id'])
 	mbox.add(msg)
 	mbox.close()
 
@@ -165,6 +166,7 @@
 		msg = mailbox.mboxMessage(properties_text)
 		msg.add_header('Message-Id', "<%s-%s-artemis@%s>" % (id, _random_id(), socket.gethostname()))
 		msg.add_header('References', mbox[0]['Message-Id'])
+		msg.add_header('In-Reply-To', mbox[0]['Message-Id'])
 		msg.set_from('artemis', True)
 		mbox.add(msg)
 	mbox.flush()
@@ -222,7 +224,7 @@
 	for i in xrange(len(mbox)):
 		m = mbox[i]
 		messages[m['Message-Id']] = (i,m)
-		children.setdefault(m['References'], []).append(m['Message-Id'])
+		children.setdefault(m['In-Reply-To'], []).append(m['Message-Id'])
 	children[None] = []				# Safeguard against infinte loop on empty Message-Id
 
 	# Iterate over children