[Rt-commit] r10328 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Sun Jan 13 17:54:47 EST 2008


Author: ruz
Date: Sun Jan 13 17:54:46 2008
New Revision: 10328

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

Log:
 r10152 at cubic-pc:  cubic | 2008-01-09 17:00:51 +0300
 * add ScripAction argument to GenMethodId function


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm	Sun Jan 13 17:54:46 2008
@@ -987,18 +987,18 @@
 
 sub GenMessageId {
     my %args = (
-        Ticket => undef,
-        Scrip  => undef,
+        Ticket      => undef,
+        Scrip       => undef,
+        ScripAction => undef,
         @_
     );
     my $org = RT->Config->Get('Organization');
-    my $res =
-        "<rt-". $RT::VERSION ."-". $$ ."-". CORE::time() ."-". int(rand(2000)) .'.'
-        . (ref($args{'Ticket'})? $args{'Ticket'}->id : $args{'Ticket'} || 0) . "-" # ticket
-        . (ref($args{'Scrip'})?  $args{'Scrip'}->id  : $args{'Scrip'}  || 0) . "-" # scrip
-        . "0" # Email sent
-        . "@". $org . ">" ;
-    return $res;
+    my $ticket_id = ( ref $args{'Ticket'}? $args{'Ticket'}->id : $args{'Ticket'} ) || 0;
+    my $scrip_id = ( ref $args{'Scrip'}? $args{'Scrip'}->id : $args{'Scrip'} ) || 0;
+    my $sent = ( ref $args{'ScripAction'}? $args{'ScripAction'}->{'_Message_ID'} : 0 ) || 0;
+
+    return "<rt-". $RT::VERSION ."-". $$ ."-". CORE::time() ."-". int(rand(2000)) .'.'
+        . $ticket_id ."-". $scrip_id ."-". $sent ."@". $org .">" ;
 }
 
 


More information about the Rt-commit mailing list