--- roundup-0.6.7/roundup/roundupdb.py 2004-02-28 14:54:49.000000000 -0800 +++ roundup-0.6.7.myers/roundup/roundupdb.py 2004-04-08 10:21:52.000000000 -0700 @@ -105,9 +105,8 @@ appended to the "messages" field of the specified issue. """ - # XXX "bcc" is an optional extra here... def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy', - from_address=None, cc=[]): #, bcc=[]): + from_address=None, cc=[], bcc=[]): """Send a message to the members of an issue's nosy list. The message is sent only to users on the nosy list who are not @@ -121,6 +120,7 @@ # figure the recipient ids sendto = [] + bcc_sendto = [] r = {} recipients = messages.get(msgid, 'recipients') for recipid in messages.get(msgid, 'recipients'): @@ -145,7 +145,7 @@ r[authid] = 1 # now deal with cc people. - for cc_userid in cc : + for cc_userid in cc: if r.has_key(cc_userid): continue # make sure they have an address @@ -155,6 +155,17 @@ sendto.append(add) recipients.append(cc_userid) + # now deal with bcc people. + for bcc_userid in bcc: + if r.has_key(bcc_userid): + continue + # make sure they have an address + add = users.get(bcc_userid, 'address') + if add: + # send it to them + bcc_sendto.append(add) + recipients.append(bcc_userid) + # now figure the nosy people who weren't recipients nosy = self.get(nodeid, whichnosy) for nosyid in nosy: @@ -179,17 +190,17 @@ note = self.generateCreateNote(nodeid) # we have new recipients - if sendto: + if sendto or bcc_sendto: # update the message's recipients list messages.set(msgid, recipients=recipients) # send the message - self.send_message(nodeid, msgid, note, sendto, from_address) + self.send_message(nodeid, msgid, note, sendto, from_address, bcc_sendto) # backwards compatibility - don't remove sendmessage = nosymessage - def send_message(self, nodeid, msgid, note, sendto, from_address=None): + def send_message(self, nodeid, msgid, note, sendto, from_address=None, bcc_sendto=None): '''Actually send the nominated message from this node to the sendto recipients, with the note appended. ''' @@ -338,6 +349,8 @@ body = writer.startbody('text/plain; charset=%s'%charset) body.write(content_encoded) + if bcc_sendto: + sendto = sendto + bcc_sendto # now try to send the message if SENDMAILDEBUG: open(SENDMAILDEBUG, 'a').write('FROM: %s\nTO: %s\n%s\n'%(