# This patch provides an option to disable ticket notifications about changes
# done by the user itself. It'll still be notified about changes made by others.
--- trac/ticket/notification.py	Wed May 13 15:24:34 2009
+++ trac/ticket/notification.py.new	Fri Jul 17 17:24:22 2009
@@ -41,6 +41,12 @@
                                        'true',
         """Always send notifications to the person who causes the ticket 
         property change.""")
+
+    notify_own_changes = BoolOption('notification', 'notify_own_changes',
+                                    'false',
+        """Send notifications even if it was triggered by the user itself. If 
+        this option is "false" all recipients will only be notified about 
+        changes made by other users.""")
         
     ticket_subject_template = Option('notification', 'ticket_subject_template', 
                                      '$prefix #$ticket.id: $summary',
@@ -235,6 +241,8 @@
                                            'always_notify_owner')
         notify_updater = self.config.getbool('notification', 
                                              'always_notify_updater')
+        notify_own_changes = self.config.getbool('notification', 
+                                                 'notify_own_changes')
 
         ccrecipients = self.prev_cc
         torecipients = []
@@ -282,6 +290,10 @@
                 torecipients = [r for r in torecipients if r and r != updater]
         elif updater:
             torecipients.append(updater)
+            
+        if not notify_own_changes and updater:
+            torecipients = [r for r in torecipients if r != updater]
+            ccrecipients = [r for r in ccrecipients if r != updater]
 
         return (torecipients, ccrecipients)
 

