[Rt-commit] rt branch, 4.2-trunk, updated. rt-4.2.9-63-ga477671

Alex Vandiver alexmv at bestpractical.com
Mon Jan 12 12:03:48 EST 2015


The branch, 4.2-trunk has been updated
       via  a47767178deab89aee8cf51efb94d6ea22cd55f1 (commit)
      from  cf78c4517267ae5f53efdbdd7017584552912737 (commit)

Summary of changes:
 lib/RT/Action/NotifyGroup.pm | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

- Log -----------------------------------------------------------------
commit a47767178deab89aee8cf51efb94d6ea22cd55f1
Author: Nathan A Boddy <nathan.boddy at gmail.com>
Date:   Thu Dec 4 05:24:33 2014 -0500

    Allow the NotifyGroup Action to respect AlwaysNotifyActor argument.
    
    RT::Action::NotifyGroup currently respects NotifyActor by explicitly
    removing the creator from its recipients, instead of relying on the
    existing RemoveInappropriateRecipients codepath it inherits from
    RT::Action::Notify.  This prevents any 'AlwaysNotifyActor' property in
    the Argument from taking effect.
    
    Leave the removal of the Actor to the parent class, RT::Action::Notify.
    This removes duplicate code and allows RemoveInappropriateRecipients (in
    Notify) to log the action, instead of removing it silently.  The
    'AlwaysNotifyActor' flag is supported by skipping its presence, if
    found, in Argument.

diff --git a/lib/RT/Action/NotifyGroup.pm b/lib/RT/Action/NotifyGroup.pm
index 847d60b..5646d7e 100644
--- a/lib/RT/Action/NotifyGroup.pm
+++ b/lib/RT/Action/NotifyGroup.pm
@@ -73,6 +73,10 @@ require RT::Group;
 =head2 SetRecipients
 
 Sets the recipients of this message to Groups and/or Users.
+Respects RT's NotifyActor configuration.
+
+To send email to the selected receipients regardless of RT's NotifyActor
+configuration, include AlwaysNotifyActor in the list of arguments.
 
 =cut
 
@@ -84,16 +88,6 @@ sub SetRecipients {
         $self->_HandleArgument( $_ );
     }
 
-    my $creatorObj = $self->TransactionObj->CreatorObj;
-    my $creator = $creatorObj->EmailAddress();
-
-    my $TransactionCurrentUser = RT::CurrentUser->new;
-    $TransactionCurrentUser->LoadByName($creatorObj->Name);
-
-    unless (RT->Config->Get('NotifyActor',$TransactionCurrentUser)) {
-        @{ $self->{'To'} } = grep ( !/^\Q$creator\E$/, @{ $self->{'To'} } );
-    }
-
     $self->{'seen_ueas'} = {};
 
     return 1;
@@ -103,6 +97,8 @@ sub _HandleArgument {
     my $self = shift;
     my $instance = shift;
 
+    return if ( $instance eq 'AlwaysNotifyActor' );
+
     if ( $instance !~ /\D/ ) {
         my $obj = RT::Principal->new( $self->CurrentUser );
         $obj->Load( $instance );

-----------------------------------------------------------------------


More information about the rt-commit mailing list