Changeset 371 for sites/trunk/trac.wordpress.org/patches/notifications.diff
- Timestamp:
- 02/04/2014 06:41:27 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/trac.wordpress.org/patches/notifications.diff
r243 r371 1 1 Index: trac-1.0.1/trac/ticket/notification.py 2 2 =================================================================== 3 --- trac-1.0.1/trac/ticket/notification.py (revision 12 333)3 --- trac-1.0.1/trac/ticket/notification.py (revision 12423) 4 4 +++ trac-1.0.1/trac/ticket/notification.py (working copy) 5 5 @@ -29,6 +29,7 @@ … … 11 11 12 12 class TicketNotificationSystem(Component): 13 @@ -94,6 +95, 43@@13 @@ -94,6 +95,57 @@ 14 14 torecipients.append(row[2]) 15 15 break … … 23 23 + milestone = ticket['milestone'] 24 24 + old_milestone = milestone 25 + focuses = ticket['focuses'] 25 26 + 26 27 + # Retrieve the old milestone/component if it just changed … … 37 38 + if change[2] == 'milestone': 38 39 + old_milestone = change[3] 40 + if change[2] == 'focuses' : 41 + focuses += ', ' + change[3] 42 + else: 43 + # Add new ticket subscribers 44 + for row in db("SELECT username FROM _notifications WHERE type = 'newticket' AND value = '1'"): 45 + torecipients.append(row[0]) 46 + 47 + # Add focus subscribers 48 + focuses = focuses.split(', ') 49 + focuses = list(set(focuses)) # de-dupe 50 + for row in db("""SELECT username FROM _notifications 51 + WHERE type = 'focus' AND value IN ( %s )""" % ','.join(['%s']*len(focuses)), focuses): 52 + torecipients.append(row[0]) 39 53 + 40 54 + # Add component subscribers … … 55 69 if notify_updater: 56 70 for author, ticket in db(""" 57 @@ -126,6 +1 64,12 @@71 @@ -126,6 +178,12 @@ 58 72 elif updater: 59 73 torecipients.append(updater)
Note: See TracChangeset
for help on using the changeset viewer.