--- trac/Notify.py.orig	Thu Jan 12 17:36:58 2006
+++ trac/Notify.py	Thu Jan 12 18:03:41 2006
@@ -159,10 +159,12 @@
     modtime = 0
     from_email = 'trac+ticket@localhost'
     COLS = 75
+    current_user = None
 
-    def __init__(self, env):
+    def __init__(self, env, username):
         NotifyEmail.__init__(self, env)
         self.prev_cc = []
+        self.current_user = username
 
     def notify(self, ticket, newticket=True, modtime=0):
         self.ticket = ticket
@@ -273,6 +275,8 @@
         notify_reporter = val.lower() in TRUE
         val = self.config.get('notification', 'always_notify_owner')
         notify_owner = val.lower() in TRUE
+        val = self.config.get('notification', 'never_notify_self')
+        skip_current = val.lower() in TRUE
 
         recipients = self.prev_cc
         cursor = self.db.cursor()
@@ -303,6 +307,10 @@
         # now convert recipients into email addresses where necessary
         emails = []
         for recipient in recipients:
+            # Don't notify the current user
+            if skip_current and self.current_user:
+                if recipient == self.current_user or recipient == self.email_map[self.current_user]:
+                   continue
             if recipient.find('@') >= 0:
                 emails.append(recipient)
             elif self.email_map.has_key(recipient):
--- trac/ticket/web_ui.py.orig	Thu Jan 12 18:02:33 2006
+++ trac/ticket/web_ui.py	Thu Jan 12 18:02:12 2006
@@ -143,7 +143,7 @@
 
         # Notify
         try:
-            tn = TicketNotifyEmail(self.env)
+            tn = TicketNotifyEmail(self.env, req.authname)
             tn.notify(ticket, newticket=True)
         except Exception, e:
             self.log.exception("Failure sending notification on creation of "
@@ -351,7 +351,7 @@
         db.commit()
 
         try:
-            tn = TicketNotifyEmail(self.env)
+            tn = TicketNotifyEmail(self.env, req.authname)
             tn.notify(ticket, newticket=False, modtime=now)
         except Exception, e:
             self.log.exception("Failure sending notification on change to "

