[Rt-devel] Patch for fine granular NotifyActor

Nabil Sayegh rt at sayegh.de
Thu Jan 8 07:22:35 EST 2009


Hello everybody,

I attached a patch for 3.8.2 that introduces more fine granular 
NotifyActorTo, NotifyActorCc and NotifyActorAdminCc in addition to the 
already existing general NotifyActor. It is fully backwards compatible, 
as the conditions are logically ORed.

rgds
--
  Nabil Sayegh
-------------- next part --------------
diff -uriwbB rt-3.8.2.orig/etc/RT_Config.pm rt-3.8.2/etc/RT_Config.pm
--- rt-3.8.2.orig/etc/RT_Config.pm	2009-01-07 02:15:52.000000000 +0100
+++ rt-3.8.2/etc/RT_Config.pm	2009-01-08 13:05:05.000000000 +0100
@@ -516,13 +516,43 @@
 =item C<$NotifyActor>
 
 By default, RT doesn't notify the person who performs an update, as they
-already know what they've done. If you'd like to change this behaviour,
-Set C<$NotifyActor> to 1
+already know what they've done. If you'd like to change this behaviour
+generally, set C<$NotifyActor> to 1
 
 =cut
 
 Set($NotifyActor, 0);
 
+=item C<$NotifyActorTo>
+
+By default, RT doesn't notify the person who performs an update, as they
+already know what they've done. If you'd like to change this behaviour
+for To, set C<$NotifyActorTo> to 1
+
+=cut
+
+Set($NotifyActorTo, 0);
+
+=item C<$NotifyActorCc>
+
+By default, RT doesn't notify the person who performs an update, as they
+already know what they've done. If you'd like to change this behaviour
+for Cc, Set C<$NotifyActorCc> to 1
+
+=cut
+
+Set($NotifyActorCc, 0);
+
+=item C<$NotifyActorAdminCc>
+
+By default, RT doesn't notify the person who performs an update, as they
+already know what they've done. If you'd like to change this behaviour
+for AdminCc, set C<$NotifyActorAdminCc> to 1
+
+=cut
+
+Set($NotifyActorAdminCc, 0);
+
 =item C<$RecordOutgoingEmail>
 
 By default, RT records each message it sends out to its own internal database.
diff -uriwbB rt-3.8.2.orig/etc/RT_Config.pm.in rt-3.8.2/etc/RT_Config.pm.in
--- rt-3.8.2.orig/etc/RT_Config.pm.in	2009-01-07 02:15:35.000000000 +0100
+++ rt-3.8.2/etc/RT_Config.pm.in	2009-01-08 13:07:03.000000000 +0100
@@ -516,13 +516,43 @@
 =item C<$NotifyActor>
 
 By default, RT doesn't notify the person who performs an update, as they
-already know what they've done. If you'd like to change this behaviour,
-Set C<$NotifyActor> to 1
+already know what they've done. If you'd like to change this behaviour
+generally, Set C<$NotifyActor> to 1
 
 =cut
 
 Set($NotifyActor, 0);
 
+=item C<$NotifyActorTo>
+
+By default, RT doesn't notify the person who performs an update, as they
+already know what they've done. If you'd like to change this behaviour
+for To, set C<$NotifyActorTo> to 1
+
+=cut
+
+Set($NotifyActorTo, 0);
+
+=item C<$NotifyActorCc>
+
+By default, RT doesn't notify the person who performs an update, as they
+already know what they've done. If you'd like to change this behaviour
+for Cc, set C<$NotifyActorCc> to 1
+
+=cut
+
+Set($NotifyActorCc, 0);
+
+=item C<$NotifyActorAdminCc>
+
+By default, RT doesn't notify the person who performs an update, as they
+already know what they've done. If you'd like to change this behaviour
+for AdminCc, set C<$NotifyActorAdminCc> to 1
+
+=cut
+
+Set($NotifyActorAdminCc, 0);
+
 =item C<$RecordOutgoingEmail>
 
 By default, RT records each message it sends out to its own internal database.
diff -uriwbB rt-3.8.2.orig/lib/RT/Action/Notify.pm rt-3.8.2/lib/RT/Action/Notify.pm
--- rt-3.8.2.orig/lib/RT/Action/Notify.pm	2009-01-07 02:15:32.000000000 +0100
+++ rt-3.8.2/lib/RT/Action/Notify.pm	2009-01-08 12:51:24.000000000 +0100
@@ -144,14 +144,24 @@
     #Strip the sender out of the To, Cc and AdminCc and set the 
     # recipients fields used to build the message by the superclass.
     # unless a flag is set 
-    if (RT->Config->Get('NotifyActor')) {
+    if (RT->Config->Get('NotifyActor') || RT->Config->Get('NotifyActorTo')) {
         @{ $self->{'To'} }  = @To;
-        @{ $self->{'Cc'} }  = @Cc;
-        @{ $self->{'Bcc'} } = @Bcc;
     }
     else {
         @{ $self->{'To'} }  = grep ( lc $_ ne lc $creator, @To );
+    }
+
+    if (RT->Config->Get('NotifyActor') || RT->Config->Get('NotifyActorCc')) {
+        @{ $self->{'Cc'} }  = @Cc;
+    }
+    else {
         @{ $self->{'Cc'} }  = grep ( lc $_ ne lc $creator, @Cc );
+    }
+
+    if (RT->Config->Get('NotifyActor') || RT->Config->Get('NotifyActorAdminCc')) {
+        @{ $self->{'Bcc'} } = @Bcc;
+    }
+    else {
         @{ $self->{'Bcc'} } = grep ( lc $_ ne lc $creator, @Bcc );
     }
     @{ $self->{'PseudoTo'} } = @PseudoTo;
diff -uriwbB rt-3.8.2.orig/lib/RT/Action/NotifyGroup.pm rt-3.8.2/lib/RT/Action/NotifyGroup.pm
--- rt-3.8.2.orig/lib/RT/Action/NotifyGroup.pm	2009-01-07 02:15:32.000000000 +0100
+++ rt-3.8.2/lib/RT/Action/NotifyGroup.pm	2009-01-08 12:52:00.000000000 +0100
@@ -91,7 +91,7 @@
     }
 
     my $creator = $self->TransactionObj->CreatorObj->EmailAddress();
-    unless( $RT::NotifyActor ) {
+    unless( $RT::NotifyActor || $RT::NotifyActorTo ) {
         @{ $self->{'To'} } = grep ( !/^\Q$creator\E$/, @{ $self->{'To'} } );
     }
 


More information about the Rt-devel mailing list