1515# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717#
18- # $Id: roundupdb.py,v 1.85 2003-04-24 07:19:58 richard Exp $
18+ # $Id: roundupdb.py,v 1.86 2003-04-27 02:24:37 richard Exp $
1919
2020__doc__ = """
2121Extending hyperdb with types specific to issue-tracking.
@@ -133,23 +133,27 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
133133 # anonymous
134134 if (users .get (authid , 'username' ) != 'anonymous' and
135135 not r .has_key (authid )):
136- if self .db .config .MESSAGES_TO_AUTHOR == 'yes' :
137- # always CC the author of the message
138- sendto .append (authid )
139- recipients .append (authid )
140- elif self .db .config .MESSAGES_TO_AUTHOR == 'new' and not oldvalues :
141- # only CC the author if the issue is new
142- sendto .append (authid )
143- recipients .append (authid )
136+ if (self .db .config .MESSAGES_TO_AUTHOR == 'yes' or
137+ (self .db .config .MESSAGES_TO_AUTHOR == 'new' and not oldvalues )):
138+ # make sure they have an address
139+ add = users .get (authid , 'address' )
140+ if add :
141+ # send it to them
142+ sendto .append (add )
143+ recipients .append (authid )
144+
144145 r [authid ] = 1
145146
146147 # now deal with cc people.
147148 for cc_userid in cc :
148149 if r .has_key (cc_userid ):
149150 continue
150- # send it to them
151- sendto .append (cc_userid )
152- recipients .append (cc_userid )
151+ # make sure they have an address
152+ add = users .get (cc_userid , 'address' )
153+ if add :
154+ # send it to them
155+ sendto .append (add )
156+ recipients .append (cc_userid )
153157
154158 # now figure the nosy people who weren't recipients
155159 nosy = self .get (nodeid , whichnosy )
@@ -161,9 +165,12 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
161165 continue
162166 # make sure they haven't seen the message already
163167 if not r .has_key (nosyid ):
164- # send it to them
165- sendto .append (nosyid )
166- recipients .append (nosyid )
168+ # make sure they have an address
169+ add = users .get (nosyid , 'address' )
170+ if add :
171+ # send it to them
172+ sendto .append (add )
173+ recipients .append (nosyid )
167174
168175 # generate a change note
169176 if oldvalues :
@@ -173,9 +180,6 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
173180
174181 # we have new recipients
175182 if sendto :
176- # map userids to addresses
177- sendto = [users .get (i , 'address' ) for i in sendto ]
178-
179183 # update the message's recipients list
180184 messages .set (msgid , recipients = recipients )
181185
0 commit comments