[Rt-commit] rt branch, 4.2/mail-references, created. rt-4.1.8-479-gc8293ff

Ruslan Zakirov ruz at bestpractical.com
Fri May 24 09:57:49 EDT 2013


The branch, 4.2/mail-references has been created
        at  c8293ffeb2901990ee34daeb19b080de07ac7182 (commit)

- Log -----------------------------------------------------------------
commit 08fe739dc70fb04dd13c37bbcdbafb44ad1173c9
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri May 24 17:34:40 2013 +0400

    move PseudoReference to ::Interface::Email

diff --git a/lib/RT/Action/SendEmail.pm b/lib/RT/Action/SendEmail.pm
index 65f99fd..ad5bdd1 100644
--- a/lib/RT/Action/SendEmail.pm
+++ b/lib/RT/Action/SendEmail.pm
@@ -1121,13 +1121,8 @@ Returns a fake Message-ID: header for the ticket to allow a base level of thread
 =cut
 
 sub PseudoReference {
-
     my $self = shift;
-    my $pseudo_ref
-        = '<RT-Ticket-'
-        . $self->TicketObj->id . '@'
-        . RT->Config->Get('Organization') . '>';
-    return $pseudo_ref;
+    return RT::Interface::Email::PseudoReference( $self->TicketObj );
 }
 
 =head2 SetHeaderAsEncoding($field_name, $charset_encoding)
diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index 868f5dc..ffe9722 100644
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -1189,7 +1189,7 @@ sub SetInReplyTo {
     }
     push @references, @id, @rtid;
     if ( $args{'Ticket'} ) {
-        my $pseudo_ref =  '<RT-Ticket-'. $args{'Ticket'}->id .'@'. RT->Config->Get('Organization') .'>';
+        my $pseudo_ref = PseudoReference( $args{'Ticket'} );
         push @references, $pseudo_ref unless grep $_ eq $pseudo_ref, @references;
     }
     @references = splice @references, 4, -6
@@ -1200,6 +1200,11 @@ sub SetInReplyTo {
     $mail->head->set( 'References' => Encode::encode_utf8(join ' ', @references) );
 }
 
+sub PseudoReference {
+    my $ticket = shift;
+    return '<RT-Ticket-'. $ticket->id .'@'. RT->Config->Get('Organization') .'>';
+}
+
 sub ExtractTicketId {
     my $entity = shift;
 

commit 9772ec2edad522fc8ba07443f395333ea8ff3f49
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri May 24 17:35:59 2013 +0400

    goal is to keep 4 first and 6 last
    
    statement was doing reverse throwing away items we want
    to keep.

diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index ffe9722..22efc85 100644
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -1192,7 +1192,7 @@ sub SetInReplyTo {
         my $pseudo_ref = PseudoReference( $args{'Ticket'} );
         push @references, $pseudo_ref unless grep $_ eq $pseudo_ref, @references;
     }
-    @references = splice @references, 4, -6
+    splice @references, 4, -6
         if @references > 10;
 
     my $mail = $args{'Message'};

commit c8293ffeb2901990ee34daeb19b080de07ac7182
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri May 24 17:38:16 2013 +0400

    pass Ticket for pseudo reference

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index ad9c247..7792b16 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -2172,7 +2172,8 @@ sub ProcessUpdateMessage {
     if ( my $msg = $old_txn->Message->First ) {
         RT::Interface::Email::SetInReplyTo(
             Message   => $Message,
-            InReplyTo => $msg
+            InReplyTo => $msg,
+            Ticket    => $args{'TicketObj'},
         );
     }
 

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


More information about the Rt-commit mailing list