[Rt-devel] ParseTicketId diverged

Jesse Vincent jesse at bestpractical.com
Mon May 23 13:50:22 EDT 2005



On Mon, May 23, 2005 at 07:45:49PM +0200, Florian Weimer wrote:
> As discussed before, RT contains two copies of the ParseTicketId
> function.  However, the $RT::EmailSubjectTagRegex change was only
> applied to the version in lib/RT/Interface/Email.pm, and not the one
> in lib/RT/EmailParser.pm.

*nod* To my knowledge nothing calls the code in emailparser, but I'll
go add a deprecation warning and make sure it instead just wraps the one
in RT::Interface::Email.


How's this patch look?


=== lib/RT/EmailParser.pm
==================================================================
--- lib/RT/EmailParser.pm  (revision 17246)
+++ lib/RT/EmailParser.pm  (local)
@@ -276,17 +276,8 @@
 
 sub ParseTicketId {
     my $self = shift;
-
-    my $Subject = shift;
-
-    if ( $Subject =~ s/\[\Q$RT::rtname\E\s+\#(\d+)\s*\]//i ) {
-        my $id = $1;
-        $RT::Logger->debug("Found a ticket ID. It's $id");
-        return ($id);
-    }
-    else {
-        return (undef);
-    }
+    $RT::Logger->warnings("RT::EmailParser->ParseTicketId deprecated. You should be using RT::Interface::Email");
+    RT::Interface::Email::ParseTicketId(@_);
 }
 
 # }}}

> _______________________________________________
> Rt-devel mailing list
> Rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
> 

-- 


More information about the Rt-devel mailing list