Skip to content

Commit f9d5b3f

Browse files
author
Erik Forsberg
committed
Make functionality for matching In-Reply-To and Message-Id work...
...even when the issue id differs from the message id.. Improved test.
1 parent abe6294 commit f9d5b3f

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

roundup/mailgw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class node. Any parts of other types are each stored in separate files
7272
an exception, the original message is bounced back to the sender with the
7373
explanatory message given in the exception.
7474
75-
$Id: mailgw.py,v 1.181 2007-01-21 15:18:26 forsberg Exp $
75+
$Id: mailgw.py,v 1.182 2007-01-21 18:08:31 forsberg Exp $
7676
"""
7777
__docformat__ = 'restructuredtext'
7878

@@ -720,7 +720,7 @@ def handle_message(self, message):
720720
if nodeid is None and inreplyto:
721721
l = self.db.getclass('msg').stringFind(messageid=inreplyto)
722722
if l:
723-
nodeid = l[0]
723+
nodeid = cl.filter(None, {'messages':l})[0]
724724

725725
# title is optional too
726726
title = m.group('title')

test/test_mailgw.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# but WITHOUT ANY WARRANTY; without even the implied warranty of
99
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010
#
11-
# $Id: test_mailgw.py,v 1.81 2007-01-21 15:22:02 forsberg Exp $
11+
# $Id: test_mailgw.py,v 1.82 2007-01-21 18:08:31 forsberg Exp $
1212

1313
# TODO: test bcc
1414

@@ -1286,7 +1286,7 @@ def testCommandDelimitersIgnore(self):
12861286
self.assertEqual(self.db.issue.get(nodeid, 'assignedto'), None)
12871287

12881288
def testReplytoMatch(self):
1289-
self.instance.config.MAILGW_SUBJECT_PREFIX_PARSING = 'loose'
1289+
self.instance.config.MAILGW_SUBJECT_PREFIX_PARSING = 'loose'
12901290
nodeid = self.doNewIssue()
12911291
nodeid2 = self._handle_mail('''Content-Type: text/plain;
12921292
charset="iso-8859-1"
@@ -1298,8 +1298,20 @@ def testReplytoMatch(self):
12981298
12991299
Followup message.
13001300
''')
1301-
self.assertEqual(nodeid, nodeid2)
13021301

1302+
nodeid3 = self._handle_mail('''Content-Type: text/plain;
1303+
charset="iso-8859-1"
1304+
From: Chef <[email protected]>
1305+
1306+
Message-Id: <dummy_test_message_id3>
1307+
In-Reply-To: <dummy_test_message_id2>
1308+
Subject: Testing...
1309+
1310+
Yet another message in the same thread/issue.
1311+
''')
1312+
1313+
self.assertEqual(nodeid, nodeid2)
1314+
self.assertEqual(nodeid, nodeid3)
13031315

13041316
def test_suite():
13051317
suite = unittest.TestSuite()

0 commit comments

Comments
 (0)