@@ -179,7 +179,7 @@ class IssueClass:
179179 )
180180
181181 # New methods:
182- def addmessage (self , nodeid , summary , text ):
182+ def addmessage (self , issueid , summary , text ):
183183 """Add a message to an issue's mail spool.
184184
185185 A new "msg" node is constructed using the current date, the user that
@@ -192,7 +192,7 @@ def addmessage(self, nodeid, summary, text):
192192 appended to the "messages" field of the specified issue.
193193 """
194194
195- def nosymessage (self , nodeid , msgid , oldvalues , whichnosy = 'nosy' ,
195+ def nosymessage (self , issueid , msgid , oldvalues , whichnosy = 'nosy' ,
196196 from_address = None , cc = [], bcc = []):
197197 """Send a message to the members of an issue's nosy list.
198198
@@ -263,7 +263,7 @@ def good_recipient(userid):
263263 seen_message [authid ] = 1
264264
265265 # now deal with the nosy and cc people who weren't recipients.
266- for userid in cc + self .get (nodeid , whichnosy ):
266+ for userid in cc + self .get (issueid , whichnosy ):
267267 if good_recipient (userid ):
268268 add_recipient (userid , sendto )
269269
@@ -273,24 +273,24 @@ def good_recipient(userid):
273273 add_recipient (userid , bcc_sendto )
274274
275275 if oldvalues :
276- note = self .generateChangeNote (nodeid , oldvalues )
276+ note = self .generateChangeNote (issueid , oldvalues )
277277 else :
278- note = self .generateCreateNote (nodeid )
278+ note = self .generateCreateNote (issueid )
279279
280280 # If we have new recipients, update the message's recipients
281281 # and send the mail.
282282 if sendto or bcc_sendto :
283283 if msgid is not None :
284284 self .db .msg .set (msgid , recipients = recipients )
285- self .send_message (nodeid , msgid , note , sendto , from_address ,
285+ self .send_message (issueid , msgid , note , sendto , from_address ,
286286 bcc_sendto )
287287
288288 # backwards compatibility - don't remove
289289 sendmessage = nosymessage
290290
291- def send_message (self , nodeid , msgid , note , sendto , from_address = None ,
291+ def send_message (self , issueid , msgid , note , sendto , from_address = None ,
292292 bcc_sendto = []):
293- '''Actually send the nominated message from this node to the sendto
293+ '''Actually send the nominated message from this issue to the sendto
294294 recipients, with the note appended.
295295 '''
296296 users = self .db .user
@@ -309,14 +309,14 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
309309 # this is an old message that didn't get a messageid, so
310310 # create one
311311 messageid = "<%s.%s.%s%s@%s>" % (time .time (), random .random (),
312- self .classname , nodeid ,
312+ self .classname , issueid ,
313313 self .db .config .MAIL_DOMAIN )
314314 if msgid is not None :
315315 messages .set (msgid , messageid = messageid )
316316
317317 # compose title
318318 cn = self .classname
319- title = self .get (nodeid , 'title' ) or '%s message copy' % cn
319+ title = self .get (issueid , 'title' ) or '%s message copy' % cn
320320
321321 # figure author information
322322 if msgid :
@@ -338,11 +338,11 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
338338
339339 # put in roundup's signature
340340 if self .db .config .EMAIL_SIGNATURE_POSITION == 'top' :
341- m .append (self .email_signature (nodeid , msgid ))
341+ m .append (self .email_signature (issueid , msgid ))
342342
343343 # add author information
344344 if authid and self .db .config .MAIL_ADD_AUTHORINFO :
345- if msgid and len (self .get (nodeid , 'messages' )) == 1 :
345+ if msgid and len (self .get (issueid , 'messages' )) == 1 :
346346 m .append (_ ("New submission from %(authname)s%(authaddr)s:" )
347347 % locals ())
348348 elif msgid :
@@ -377,7 +377,7 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
377377
378378 # put in roundup's signature
379379 if self .db .config .EMAIL_SIGNATURE_POSITION == 'bottom' :
380- m .append (self .email_signature (nodeid , msgid ))
380+ m .append (self .email_signature (issueid , msgid ))
381381
382382 # figure the encoding
383383 charset = getattr (self .db .config , 'EMAIL_CHARSET' , 'utf-8' )
@@ -397,7 +397,7 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
397397 if from_tag :
398398 from_tag = ' ' + from_tag
399399
400- subject = '[%s%s] %s' % (cn , nodeid , title )
400+ subject = '[%s%s] %s' % (cn , issueid , title )
401401 author = (authname + from_tag , from_address )
402402
403403 # send an individual message per recipient?
@@ -441,12 +441,12 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
441441 if not 'name' in cl .getprops ():
442442 continue
443443 if isinstance (prop , hyperdb .Link ):
444- value = self .get (nodeid , propname )
444+ value = self .get (issueid , propname )
445445 if value is None :
446446 continue
447447 values = [value ]
448448 else :
449- values = self .get (nodeid , propname )
449+ values = self .get (issueid , propname )
450450 if not values :
451451 continue
452452 values = [cl .get (v , 'name' ) for v in values ]
@@ -459,11 +459,11 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
459459
460460 if not inreplyto :
461461 # Default the reply to the first message
462- msgs = self .get (nodeid , 'messages' )
462+ msgs = self .get (issueid , 'messages' )
463463 # Assume messages are sorted by increasing message number here
464464 # If the issue is just being created, and the submitter didn't
465465 # provide a message, then msgs will be empty.
466- if msgs and msgs [0 ] != nodeid :
466+ if msgs and msgs [0 ] != msgid :
467467 inreplyto = messages .get (msgs [0 ], 'messageid' )
468468 if inreplyto :
469469 message ['In-Reply-To' ] = inreplyto
@@ -515,7 +515,7 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
515515 mailer .smtp_send (sendto , message .as_string ())
516516 first = False
517517
518- def email_signature (self , nodeid , msgid ):
518+ def email_signature (self , issueid , msgid ):
519519 ''' Add a signature to the e-mail with some useful information
520520 '''
521521 # simplistic check to see if the url is valid,
@@ -528,7 +528,7 @@ def email_signature(self, nodeid, msgid):
528528 else :
529529 if not base .endswith ('/' ):
530530 base = base + '/'
531- web = base + self .classname + nodeid
531+ web = base + self .classname + issueid
532532
533533 # ensure the email address is properly quoted
534534 email = formataddr ((self .db .config .TRACKER_NAME ,
@@ -538,7 +538,7 @@ def email_signature(self, nodeid, msgid):
538538 return '\n %s\n %s\n <%s>\n %s' % (line , email , web , line )
539539
540540
541- def generateCreateNote (self , nodeid ):
541+ def generateCreateNote (self , issueid ):
542542 """Generate a create note that lists initial property values
543543 """
544544 cn = self .classname
@@ -550,7 +550,7 @@ def generateCreateNote(self, nodeid):
550550 prop_items = props .items ()
551551 prop_items .sort ()
552552 for propname , prop in prop_items :
553- value = cl .get (nodeid , propname , None )
553+ value = cl .get (issueid , propname , None )
554554 # skip boring entries
555555 if not value :
556556 continue
@@ -580,7 +580,7 @@ def generateCreateNote(self, nodeid):
580580 m .insert (0 , '' )
581581 return '\n ' .join (m )
582582
583- def generateChangeNote (self , nodeid , oldvalues ):
583+ def generateChangeNote (self , issueid , oldvalues ):
584584 """Generate a change note that lists property changes
585585 """
586586 if not isinstance (oldvalues , type ({})):
@@ -601,7 +601,7 @@ def generateChangeNote(self, nodeid, oldvalues):
601601 # not all keys from oldvalues might be available in database
602602 # this happens when property was deleted
603603 try :
604- new_value = cl .get (nodeid , key )
604+ new_value = cl .get (issueid , key )
605605 except KeyError :
606606 continue
607607 # the old value might be non existent
@@ -622,7 +622,7 @@ def generateChangeNote(self, nodeid, oldvalues):
622622 changed_items .sort ()
623623 for propname , oldvalue in changed_items :
624624 prop = props [propname ]
625- value = cl .get (nodeid , propname , None )
625+ value = cl .get (issueid , propname , None )
626626 if isinstance (prop , hyperdb .Link ):
627627 link = self .db .classes [prop .classname ]
628628 key = link .labelprop (default_to_id = 1 )
0 commit comments