[Rt-commit] rt branch, 4.0/simplesearch-domain, created. rt-4.0.13-65-g71fd965

Alex Vandiver alexmv at bestpractical.com
Thu Jun 13 15:02:25 EDT 2013


The branch, 4.0/simplesearch-domain has been created
        at  71fd965909a9245aa33a33c86a07ff3522b56e35 (commit)

- Log -----------------------------------------------------------------
commit 71fd965909a9245aa33a33c86a07ff3522b56e35
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jun 13 15:01:59 2013 -0400

    Allow searching for @hostname.tld to find all requestors at that domain

diff --git a/lib/RT/Search/Googleish.pm b/lib/RT/Search/Googleish.pm
index f8465f0..1c678d3 100644
--- a/lib/RT/Search/Googleish.pm
+++ b/lib/RT/Search/Googleish.pm
@@ -197,6 +197,7 @@ our @GUESS = (
     [ 10 => sub { return "subject" if $_[1] } ],
     [ 20 => sub { return "id" if /^#?\d+$/ } ],
     [ 30 => sub { return "requestor" if /\w+@\w+/} ],
+    [ 35 => sub { return "domain" if /^@\w+/} ],
     [ 40 => sub {
           return "status" if RT::Queue->new( $_[2] )->IsValidStatus( $_ )
       }],
@@ -260,6 +261,7 @@ sub HandleWatcher     {
     return watcher => (!$_[2] and $_[1] eq "me") ? "Watcher.id = '__CurrentUser__'" : "Watcher = '$_[1]'";
 }
 sub HandleRequestor { return requestor => "Requestor STARTSWITH '$_[1]'";  }
+sub HandleDomain    { $_[1] =~ s/^@?/@/; return requestor => "Requestor ENDSWITH '$_[1]'";  }
 sub HandleQueue     { return queue     => "Queue = '$_[1]'";      }
 sub HandleQ         { return queue     => "Queue = '$_[1]'";      }
 sub HandleCf        { return "cf.$_[3]" => "'CF.{$_[3]}' LIKE '$_[1]'"; }

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


More information about the Rt-commit mailing list