[Rt-commit] rt branch, create-action, updated. 243ee3458b5b6ae1d79a073cc30b0c1f7aab74aa

sartak at bestpractical.com sartak at bestpractical.com
Thu Nov 5 16:24:56 EST 2009


The branch, create-action has been updated
       via  243ee3458b5b6ae1d79a073cc30b0c1f7aab74aa (commit)
      from  3df1f2c504b124466bbefe5f0f96bd12ffc90212 (commit)

Summary of changes:
 lib/RT/Model/Ticket.pm |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 243ee3458b5b6ae1d79a073cc30b0c1f7aab74aa
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Nov 5 16:24:34 2009 -0500

    Canonicalize content string into a mime_obj in Ticket->create

diff --git a/lib/RT/Model/Ticket.pm b/lib/RT/Model/Ticket.pm
index ee828ee..9b1a503 100755
--- a/lib/RT/Model/Ticket.pm
+++ b/lib/RT/Model/Ticket.pm
@@ -473,6 +473,26 @@ sub create {
     $args{'priority'} = $args{'initial_priority'}
         unless defined $args{'priority'};
 
+# Initial message {{{
+    if (!$args{mime_obj}) {
+        my $sigless = RT::Interface::Web::strip_content(
+            content         => $args{'content'},
+            content_type    => $args{'content_type'},
+            strip_signature => 1,
+            current_user    => $self->current_user,
+        );
+
+        # XXX: move make_mime_entity somewhere sane
+        $args{mime_obj} = HTML::Mason::Commands::make_mime_entity(
+            subject => $args{'subject'},
+            from    => $args{'from'},
+            cc      => $args{'cc'},
+            body    => $sigless,
+            type    => $args{'content_type'},
+        );
+    }
+# }}}
+
     # {{{ Dates
     #Set the due date. if we didn't get fed one, use the queue default due in
     my $due;

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


More information about the Rt-commit mailing list