[Rt-commit] r6856 - in rt/branches/3.7-EXPERIMENTAL-RTIR-2.2: .

ruz at bestpractical.com ruz at bestpractical.com
Fri Jan 26 14:05:44 EST 2007


Author: ruz
Date: Fri Jan 26 14:05:43 2007
New Revision: 6856

Modified:
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.2/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.2/lib/RT/Interface/Email.pm

Log:
 r4425 at cubic-pc (orig r6789):  ruz | 2007-01-21 07:50:29 +0300
 * that was wrong idea to run next mail plugins for some action
   if the current plugin said that everything was done (returned
   status -2).


Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.2/lib/RT/Interface/Email.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.2/lib/RT/Interface/Email.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.2/lib/RT/Interface/Email.pm	Fri Jan 26 14:05:43 2007
@@ -734,6 +734,10 @@
             $skip_action{$action}++ if $AuthStat == -2;
         }
 
+        # strip actions we should skip
+        @actions = grep !$skip_action{$_}, @actions if $AuthStat == -2;
+        last unless @actions;
+
         last if $AuthStat == -1;
     }
     # {{{ If authentication fails and no new user was created, get out.
@@ -783,9 +787,6 @@
         return ( 0, $result, undef );
     }
     
-    # strip actions we should skip
-    @actions = grep !$skip_action{$_}, @actions;
-
     # if plugin's updated SystemTicket then update arguments
     $args{'ticket'} = $SystemTicket->Id if $SystemTicket && $SystemTicket->Id;
 
@@ -827,7 +828,7 @@
         @actions = grep !/^(comment|correspond)$/, @actions;
         $args{'ticket'} = $id;
 
-    } else {
+    } elsif ( $args{'ticket'} ) {
 
         $Ticket->Load( $args{'ticket'} );
         unless ( $Ticket->Id ) {
@@ -841,6 +842,9 @@
 
             return ( 0, $error );
         }
+        $args{'ticket'} = $Ticket->id;
+    } else {
+        return ( 1, "Success", $Ticket );
     }
 
     # }}}


More information about the Rt-commit mailing list