[Rt-commit] rt branch, 4.4/never-notify-actor, created. rt-4.4.1-330-gc0ead3c
Shawn Moore
shawn at bestpractical.com
Fri Apr 14 17:27:12 EDT 2017
The branch, 4.4/never-notify-actor has been created
at c0ead3c38e877409d74b6c2b115a20a9ceeaefb7 (commit)
- Log -----------------------------------------------------------------
commit c0ead3c38e877409d74b6c2b115a20a9ceeaefb7
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Fri Apr 14 17:26:25 2017 -0400
Add support for a NeverNotifyActor argument to Notify actions
Fixes: T#184265
diff --git a/lib/RT/Action/Notify.pm b/lib/RT/Action/Notify.pm
index 5ce594c..a74d61e 100644
--- a/lib/RT/Action/Notify.pm
+++ b/lib/RT/Action/Notify.pm
@@ -139,7 +139,8 @@ sub SetRecipients {
|| $name eq 'AdminCc'
|| $name eq 'Cc'
|| $name eq 'OtherRecipients'
- || $name eq 'AlwaysNotifyActor';
+ || $name eq 'AlwaysNotifyActor'
+ || $name eq 'NeverNotifyActor';
my $roles = RT::CustomRoles->new( $self->CurrentUser );
$roles->Limit( FIELD => 'Name', VALUE => $name, CASESENSITIVE => 0 );
@@ -237,8 +238,10 @@ sub SetRecipients {
Remove transaction creator as appropriate for the NotifyActor setting.
-To send email to the selected receipients regardless of RT's NotifyActor
-configuration, include AlwaysNotifyActor in the list of arguments.
+To send email to the selected recipients regardless of RT's NotifyActor
+configuration, include AlwaysNotifyActor in the list of arguments. Or to
+always suppress email to the selected recipients regardless of RT's
+NotifyActor configuration, include NeverNotifyActor in the list of arguments.
=cut
@@ -255,8 +258,9 @@ sub RemoveInappropriateRecipients {
return unless lc $_[0] eq lc $creator;
return "not sending to $creator, creator of the transaction, due to NotifyActor setting";
},
- ) unless RT->Config->Get('NotifyActor',$TransactionCurrentUser)
- || $self->Argument =~ /\bAlwaysNotifyActor\b/;
+ ) if $self->Argument =~ /\bNeverNotifyActor\b/ ||
+ (!RT->Config->Get('NotifyActor',$TransactionCurrentUser)
+ && $self->Argument !~ /\bAlwaysNotifyActor\b/);
$self->SUPER::RemoveInappropriateRecipients();
}
diff --git a/lib/RT/Action/NotifyGroup.pm b/lib/RT/Action/NotifyGroup.pm
index 41f2b78..bc0a159 100644
--- a/lib/RT/Action/NotifyGroup.pm
+++ b/lib/RT/Action/NotifyGroup.pm
@@ -97,7 +97,8 @@ sub _HandleArgument {
my $self = shift;
my $instance = shift;
- return if ( $instance eq 'AlwaysNotifyActor' );
+ return if $instance eq 'AlwaysNotifyActor'
+ || $instance eq 'NeverNotifyActor';
if ( $instance !~ /\D/ ) {
my $obj = RT::Principal->new( $self->CurrentUser );
-----------------------------------------------------------------------
More information about the rt-commit
mailing list