From: richard Date: Tue, 30 Oct 2001 00:54:45 +0000 (+0000) Subject: Features: X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6493b4a38c2d28282322017c539063cee050974b;p=roundup.git Features: . #467129 ] Lossage when username=e-mail-address . #473123 ] Change message generation for author . MailGW now moves 'resolved' to 'chatting' on receiving e-mail for an issue. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@348 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index 611daf3..1a0a6be 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,11 @@ This file contains the changes to the Roundup system over time. The entries are given with the most recent entry first. 2001-10-?? - 0.3.0 +Feature: + . #467129 ] Lossage when username=e-mail-address + . #473123 ] Change message generation for author + . MailGW now moves 'resolved' to 'chatting' on receiving e-mail for an issue. + Fixed: . Fixed a bug in HTMLTemplate changes. . 'unread' to 'chatting' automagic status change was b0rken. diff --git a/MIGRATION.txt b/MIGRATION.txt index 15610ca..19ed5bd 100644 --- a/MIGRATION.txt +++ b/MIGRATION.txt @@ -77,3 +77,7 @@ FILTER_POSITION, ANONYMOUS_ACCESS, ANONYMOUS_REGISTER have been added to the instance_config.py. Simplest solution is to copy the default values from template in the core source. +MESSAGES_TO_AUTHOR has been added to the IssueClass in dbinit.py. Set to 'yes' +to send nosy messages to the author. Default behaviour is to not send nosy +messages to the author. + diff --git a/roundup/mailgw.py b/roundup/mailgw.py index 76e2638..3826a09 100644 --- a/roundup/mailgw.py +++ b/roundup/mailgw.py @@ -72,7 +72,7 @@ are calling the create() method to create a new node). If an auditor raises an exception, the original message is bounced back to the sender with the explanatory message given in the exception. -$Id: mailgw.py,v 1.25 2001-10-28 23:22:28 richard Exp $ +$Id: mailgw.py,v 1.26 2001-10-30 00:54:45 richard Exp $ ''' @@ -365,17 +365,20 @@ Subject was: "%s" messages.append(message_id) props['messages'] = messages - # if the message is currently 'unread', then set it to 'chatting' + # if the message is currently 'unread' or 'resolved', then set + # it to 'chatting' if properties.has_key('status'): try: - # determine the id of 'unread' and 'chatting' + # determine the id of 'unread', 'resolved' and 'chatting' unread_id = self.db.status.lookup('unread') + resolved_id = self.db.status.lookup('resolved') chatting_id = self.db.status.lookup('chatting') except KeyError: pass else: if (not props.has_key('status') or - props['status'] == unread_id): + props['status'] == unread_id or + props['status'] == resolved_id): props['status'] = chatting_id cl.set(nodeid, **props) @@ -441,6 +444,9 @@ def parseContent(content, blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'), # # $Log: not supported by cvs2svn $ +# Revision 1.25 2001/10/28 23:22:28 richard +# fixed bug #474749 ] Indentations lost +# # Revision 1.24 2001/10/23 22:57:52 richard # Fix unread->chatting auto transition, thanks Roch'e # diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py index 099c1c6..ab3e0f3 100644 --- a/roundup/roundupdb.py +++ b/roundup/roundupdb.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundupdb.py,v 1.15 2001-10-23 01:00:18 richard Exp $ +# $Id: roundupdb.py,v 1.16 2001-10-30 00:54:45 richard Exp $ import re, os, smtplib, socket @@ -44,7 +44,23 @@ class Database: ''' (realname, address) = address users = self.user.stringFind(address=address) - if users: return users[0] + for dummy in range(2): + if len(users) > 1: + # make sure we don't match the anonymous or admin user + for user in users: + if user == '1': continue + if self.user.get(user, 'username') == 'anonymous': continue + # first valid match will do + return user + # well, I guess we have no choice + return user[0] + elif users: + return users[0] + # try to match the username to the address (for local + # submissions where the address is empty) + users = self.user.stringFind(username=address) + + # couldn't match address or username, so create a new user return self.user.create(username=address, address=address, realname=realname) @@ -200,6 +216,9 @@ class FileClass(Class): # XXX deviation from spec - was called ItemClass class IssueClass(Class): + # configuration + MESSAGES_TO_AUTHOR = 'no' + # Overridden methods: def __init__(self, db, classname, **properties): @@ -247,13 +266,25 @@ class IssueClass(Class): r = {} for recipid in recipients: r[recipid] = 1 + + # figure the author's id, and indicate they've received the message authid = self.db.msg.get(msgid, 'author') r[authid] = 1 - # now figure the nosy people who weren't recipients sendto = [] + # ... but duplicate the message to the author as long as it's not + # the anonymous user + if (self.MESSAGES_TO_AUTHOR == 'yes' and + self.db.user.get(authid, 'username') != 'anonymous'): + sendto.append(authid) + + # now figure the nosy people who weren't recipients nosy = self.get(nodeid, 'nosy') for nosyid in nosy: + # Don't send nosy mail to the anonymous user (that user + # shouldn't appear in the nosy list, but just in case they + # do...) + if self.db.user.get(nosyid, 'username') == 'anonymous': continue if not r.has_key(nosyid): sendto.append(nosyid) recipients.append(nosyid) @@ -278,6 +309,7 @@ class IssueClass(Class): # TODO attachments m = ['Subject: [%s%s] %s'%(cn, nodeid, title)] m.append('To: %s'%', '.join(sendto)) + m.append('From: %s'%self.ISSUE_TRACKER_EMAIL) m.append('Reply-To: %s'%self.ISSUE_TRACKER_EMAIL) m.append('') # add author information @@ -307,6 +339,13 @@ Roundup issue tracker # # $Log: not supported by cvs2svn $ +# Revision 1.15 2001/10/23 01:00:18 richard +# Re-enabled login and registration access after lopping them off via +# disabling access for anonymous users. +# Major re-org of the htmltemplate code, cleaning it up significantly. Fixed +# a couple of bugs while I was there. Probably introduced a couple, but +# things seem to work OK at the moment. +# # Revision 1.14 2001/10/21 07:26:35 richard # feature #473127: Filenames. I modified the file.index and htmltemplate # source so that the filename is used in the link and the creation diff --git a/roundup/templates/classic/dbinit.py b/roundup/templates/classic/dbinit.py index 45ee343..a48553c 100644 --- a/roundup/templates/classic/dbinit.py +++ b/roundup/templates/classic/dbinit.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: dbinit.py,v 1.8 2001-10-09 07:25:59 richard Exp $ +# $Id: dbinit.py,v 1.9 2001-10-30 00:54:45 richard Exp $ import os @@ -39,6 +39,7 @@ class IssueClass(roundupdb.IssueClass): ISSUE_TRACKER_EMAIL = instance_config.ISSUE_TRACKER_EMAIL ADMIN_EMAIL = instance_config.ADMIN_EMAIL MAILHOST = instance_config.MAILHOST + MESSAGES_TO_AUTHOR = instance_config.MESSAGES_TO_AUTHOR def open(name=None): @@ -125,6 +126,10 @@ def init(adminpw): # # $Log: not supported by cvs2svn $ +# Revision 1.8 2001/10/09 07:25:59 richard +# Added the Password property type. See "pydoc roundup.password" for +# implementation details. Have updated some of the documentation too. +# # Revision 1.7 2001/08/07 00:24:43 richard # stupid typo # diff --git a/roundup/templates/classic/detectors/nosyreaction.py b/roundup/templates/classic/detectors/nosyreaction.py index 052cf1f..df0651e 100644 --- a/roundup/templates/classic/detectors/nosyreaction.py +++ b/roundup/templates/classic/detectors/nosyreaction.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: nosyreaction.py,v 1.3 2001-08-07 00:24:43 richard Exp $ +#$Id: nosyreaction.py,v 1.4 2001-10-30 00:54:45 richard Exp $ def nosyreaction(db, cl, nodeid, oldvalues): ''' A standard detector is provided that watches for additions to the @@ -58,16 +58,20 @@ def nosyreaction(db, cl, nodeid, oldvalues): n = {} for nosyid in nosy: n[nosyid] = 1 change = 0 - # but don't add admin to the nosy list + # but don't add admin or the anonymous user to the nosy list for msgid in messages: for recipid in db.msg.get(msgid, 'recipients'): - if recipid != '1' and not n.has_key(recipid): - change = 1 - nosy.append(recipid) - authid = db.msg.get(msgid, 'author') - if authid != '1' and not n.has_key(authid): + if recipid == '1': continue + if n.has_key(recipid): continue + if db.user.get(recipid, 'username') == 'anonymous': continue change = 1 - nosy.append(authid) + nosy.append(recipid) + authid = db.msg.get(msgid, 'author') + if authid == '1': continue + if n.has_key(authid): continue + if db.user.get(authid, 'username') == 'anonymous': continue + change = 1 + nosy.append(authid) if change: cl.set(nodeid, nosy=nosy) @@ -78,6 +82,9 @@ def init(db): # #$Log: not supported by cvs2svn $ +#Revision 1.3 2001/08/07 00:24:43 richard +#stupid typo +# #Revision 1.2 2001/08/07 00:15:51 richard #Added the copyright/license notice to (nearly) all files at request of #Bizar Software. diff --git a/roundup/templates/classic/instance_config.py b/roundup/templates/classic/instance_config.py index f02335d..de3759f 100644 --- a/roundup/templates/classic/instance_config.py +++ b/roundup/templates/classic/instance_config.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: instance_config.py,v 1.8 2001-10-23 01:00:18 richard Exp $ +# $Id: instance_config.py,v 1.9 2001-10-30 00:54:45 richard Exp $ MAIL_DOMAIN=MAILHOST=HTTP_HOST=None HTTP_PORT=0 @@ -71,8 +71,18 @@ ANONYMOUS_ACCESS = 'deny' # either 'deny' or 'allow' # Deny or allow anonymous users to register through the web interface ANONYMOUS_REGISTER = 'deny' # either 'deny' or 'allow' +# Send nosy messages to the author of the message +MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no' + # # $Log: not supported by cvs2svn $ +# Revision 1.8 2001/10/23 01:00:18 richard +# Re-enabled login and registration access after lopping them off via +# disabling access for anonymous users. +# Major re-org of the htmltemplate code, cleaning it up significantly. Fixed +# a couple of bugs while I was there. Probably introduced a couple, but +# things seem to work OK at the moment. +# # Revision 1.7 2001/10/22 03:25:01 richard # Added configuration for: # . anonymous user access and registration (deny/allow) diff --git a/roundup/templates/extended/dbinit.py b/roundup/templates/extended/dbinit.py index 8dcbb3e..a730a5c 100644 --- a/roundup/templates/extended/dbinit.py +++ b/roundup/templates/extended/dbinit.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: dbinit.py,v 1.12 2001-10-09 07:25:59 richard Exp $ +# $Id: dbinit.py,v 1.13 2001-10-30 00:54:45 richard Exp $ import os @@ -39,6 +39,7 @@ class IssueClass(roundupdb.IssueClass): ISSUE_TRACKER_EMAIL = instance_config.ISSUE_TRACKER_EMAIL ADMIN_EMAIL = instance_config.ADMIN_EMAIL MAILHOST = instance_config.MAILHOST + MESSAGES_TO_AUTHOR = instance_config.MESSAGES_TO_AUTHOR def open(name=None): @@ -175,6 +176,10 @@ def init(adminpw): # # $Log: not supported by cvs2svn $ +# Revision 1.12 2001/10/09 07:25:59 richard +# Added the Password property type. See "pydoc roundup.password" for +# implementation details. Have updated some of the documentation too. +# # Revision 1.11 2001/08/07 00:24:43 richard # stupid typo # diff --git a/roundup/templates/extended/detectors/nosyreaction.py b/roundup/templates/extended/detectors/nosyreaction.py index 6a9edf8..45e6cee 100644 --- a/roundup/templates/extended/detectors/nosyreaction.py +++ b/roundup/templates/extended/detectors/nosyreaction.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: nosyreaction.py,v 1.3 2001-08-07 00:24:43 richard Exp $ +#$Id: nosyreaction.py,v 1.4 2001-10-30 00:54:45 richard Exp $ def nosyreaction(db, cl, nodeid, oldvalues): ''' A standard detector is provided that watches for additions to the @@ -58,16 +58,20 @@ def nosyreaction(db, cl, nodeid, oldvalues): n = {} for nosyid in nosy: n[nosyid] = 1 change = 0 - # but don't add admin to the nosy list + # but don't add admin or the anonymous user to the nosy list for msgid in messages: for recipid in db.msg.get(msgid, 'recipients'): - if recipid != '1' and not n.has_key(recipid): - change = 1 - nosy.append(recipid) - authid = db.msg.get(msgid, 'author') - if authid != '1' and not n.has_key(authid): + if recipid == '1': continue + if n.has_key(recipid): continue + if db.user.get(recipid, 'username') == 'anonymous': continue change = 1 - nosy.append(authid) + nosy.append(recipid) + authid = db.msg.get(msgid, 'author') + if authid == '1': continue + if n.has_key(authid): continue + if db.user.get(authid, 'username') == 'anonymous': continue + change = 1 + nosy.append(authid) if change: cl.set(nodeid, nosy=nosy) @@ -78,6 +82,9 @@ def init(db): # #$Log: not supported by cvs2svn $ +#Revision 1.3 2001/08/07 00:24:43 richard +#stupid typo +# #Revision 1.2 2001/08/07 00:15:51 richard #Added the copyright/license notice to (nearly) all files at request of #Bizar Software. diff --git a/roundup/templates/extended/instance_config.py b/roundup/templates/extended/instance_config.py index 3260bfa..78bff5b 100644 --- a/roundup/templates/extended/instance_config.py +++ b/roundup/templates/extended/instance_config.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: instance_config.py,v 1.8 2001-10-23 01:00:18 richard Exp $ +# $Id: instance_config.py,v 1.9 2001-10-30 00:54:45 richard Exp $ MAIL_DOMAIN=MAILHOST=HTTP_HOST=None HTTP_PORT=0 @@ -71,8 +71,18 @@ ANONYMOUS_ACCESS = 'deny' # Deny or allow anonymous users to register through the web interface ANONYMOUS_REGISTER = 'deny' +# Send nosy messages to the author of the message +MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no' + # # $Log: not supported by cvs2svn $ +# Revision 1.8 2001/10/23 01:00:18 richard +# Re-enabled login and registration access after lopping them off via +# disabling access for anonymous users. +# Major re-org of the htmltemplate code, cleaning it up significantly. Fixed +# a couple of bugs while I was there. Probably introduced a couple, but +# things seem to work OK at the moment. +# # Revision 1.7 2001/10/22 03:25:01 richard # Added configuration for: # . anonymous user access and registration (deny/allow)