Skip to content

Commit d6e105a

Browse files
author
Richard Jones
committed
Fixes from Martin v. Löwis:
- Messages created through the web are now given an in-reply-to header when email out to nosy - Nosy messages now include more information about issues (all link properties with a "name" attribute)
1 parent af876b4 commit d6e105a

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Feature:
88
of a message in multipart/alternative attachments.
99
- Admin copy of error email from mailgw includes traceback (thanks Ulrik
1010
Mikaelsson)
11+
- Messages created through the web are now given an in-reply-to header
12+
when email out to nosy (thanks Martin v. L�wis)
13+
- Nosy messages now include more information about issues (all link
14+
properties with a "name" attribute) (thanks Martin v. L�wis)
1115

1216
Fixed:
1317
- Searching date range by supplying just a date as the filter spec

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ Detlef Lannert,
124124
Andrey Lebedev,
125125
Henrik Levkowetz,
126126
David Linke,
127+
Martin v. L�wis,
127128
Fredrik Lundh,
128129
Will Maier,
129130
Georges Martin,

roundup/roundupdb.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: roundupdb.py,v 1.135 2007-11-07 20:47:12 richard Exp $
19+
# $Id: roundupdb.py,v 1.136 2008-01-08 20:55:26 richard Exp $
2020

2121
"""Extending hyperdb with types specific to issue-tracking.
2222
"""
@@ -397,6 +397,39 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
397397
if inreplyto:
398398
writer.addheader('In-Reply-To', inreplyto)
399399

400+
# Additional headers for bugs.python.org
401+
# 20080106 mvl
402+
403+
# Generate a header for each link or multilink to
404+
# a class that has a name attribute
405+
for propname, prop in self.getprops().items():
406+
if not isinstance(prop, (hyperdb.Link, hyperdb.Multilink)):
407+
continue
408+
cl = self.db.getclass(prop.classname)
409+
if not 'name' in cl.getprops():
410+
continue
411+
if isinstance(prop, hyperdb.Link):
412+
value = self.get(nodeid, propname)
413+
if value is None:
414+
continue
415+
values = [value]
416+
else:
417+
values = self.get(nodeid, propname)
418+
if not values:
419+
continue
420+
values = [cl.get(v, 'name') for v in values]
421+
values = ', '.join(values)
422+
writer.addheader("X-Roundup-%s-%s" % (self.classname, propname),
423+
values)
424+
if not inreplyto:
425+
# Default the reply to the first message
426+
msgs = self.get(nodeid, 'messages')
427+
# Assume messages are sorted by increasing message number here
428+
if msgs[0] != nodeid:
429+
inreplyto = messages.get(msgs[0], 'messageid')
430+
writer.addheader('In-Reply-To', inreplyto)
431+
# end additional headers
432+
400433
# attach files
401434
if message_files:
402435
part = writer.startmultipartbody('mixed')

0 commit comments

Comments
 (0)