about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-13 19:06:22 -1200
committerEric Wong <e@80x24.org>2021-01-14 23:14:08 +0000
commitd1a287d4eede2c1112b73980871efb5e0203c6f3 (patch)
tree06db464ef56fc11d7ad0d73eeafec489c1018665
parent97a3b1b79eda65b494e9c01bc99afb4df33a32d5 (diff)
downloadpublic-inbox-d1a287d4eede2c1112b73980871efb5e0203c6f3.tar.gz
Meaning "Received time", as it is the best description of the
value we use from the "Received:" header, if present.  JMAP
calls it "receivedAt", but "rt:" seems like a better
abbreviation being in line with "dt:" for the "Date" header.

"Timestamp" ("ts") was potentially ambiguous given the presence
of the "Date" header.
-rw-r--r--lib/PublicInbox/IMAPsearchqp.pm6
-rw-r--r--lib/PublicInbox/LeiOverview.pm2
-rw-r--r--lib/PublicInbox/Search.pm2
-rw-r--r--t/imap_searchqp.t6
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/PublicInbox/IMAPsearchqp.pm b/lib/PublicInbox/IMAPsearchqp.pm
index 78d9a206..2fb92bb8 100644
--- a/lib/PublicInbox/IMAPsearchqp.pm
+++ b/lib/PublicInbox/IMAPsearchqp.pm
@@ -124,7 +124,7 @@ sub ON {
         my ($self, $item) = @_;
         my $ts = yyyymmdd($item);
         my $end = $ts + 86399; # no leap day
-        push @{$self->{xap}}, "ts:$ts..$end";
+        push @{$self->{xap}}, "rt:$ts..$end";
         my $sql = $self->{sql} or return 1;
         $$sql .= " AND ts >= $ts AND ts <= $end";
 }
@@ -132,7 +132,7 @@ sub ON {
 sub BEFORE {
         my ($self, $item) = @_;
         my $ts = yyyymmdd($item);
-        push @{$self->{xap}}, "ts:..$ts";
+        push @{$self->{xap}}, "rt:..$ts";
         my $sql = $self->{sql} or return 1;
         $$sql .= " AND ts <= $ts";
 }
@@ -140,7 +140,7 @@ sub BEFORE {
 sub SINCE {
         my ($self, $item) = @_;
         my $ts = yyyymmdd($item);
-        push @{$self->{xap}}, "ts:$ts..";
+        push @{$self->{xap}}, "rt:$ts..";
         my $sql = $self->{sql} or return 1;
         $$sql .= " AND ts >= $ts";
 }
diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm
index 194c5e28..080fe837 100644
--- a/lib/PublicInbox/LeiOverview.pm
+++ b/lib/PublicInbox/LeiOverview.pm
@@ -86,7 +86,7 @@ sub _unbless_smsg {
         my ($smsg, $mitem) = @_;
 
         delete @$smsg{qw(lines bytes num tid)};
-        $smsg->{rcvd} = _iso8601(delete $smsg->{ts}); # JMAP receivedAt
+        $smsg->{rt} = _iso8601(delete $smsg->{ts}); # JMAP receivedAt
         $smsg->{dt} = _iso8601(delete $smsg->{ds}); # JMAP UTCDate
         $smsg->{relevance} = get_pct($mitem) if $mitem;
 
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 7f68ee01..a4b40f94 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -376,7 +376,7 @@ sub qparse_new ($) {
 
         # for IMAP, undocumented for WWW and may be split off go away
         $cb->($qp, $NVRP->new(BYTES, 'bytes:'));
-        $cb->($qp, $NVRP->new(TS, 'ts:'));
+        $cb->($qp, $NVRP->new(TS, 'rt:'));
         $cb->($qp, $NVRP->new(UID, 'uid:'));
 
         while (my ($name, $prefix) = each %bool_pfx_external) {
diff --git a/t/imap_searchqp.t b/t/imap_searchqp.t
index 049fd680..6b4121ea 100644
--- a/t/imap_searchqp.t
+++ b/t/imap_searchqp.t
@@ -76,17 +76,17 @@ is($q->{xap}, 'c:"b" d:..19931002', 'compound query w/ parens');
         $q = $parse->($s = qq{BEFORE 2-Oct-1993});
         is_deeply($q->{sql}, \" AND ts <= $t0", 'BEFORE SQL');
         $q = $parse->("FROM z $s");
-        is($q->{xap}, qq{f:"z" ts:..$t0}, 'BEFORE Xapian');
+        is($q->{xap}, qq{f:"z" rt:..$t0}, 'BEFORE Xapian');
 
         $q = $parse->($s = qq{SINCE 2-Oct-1993});
         is_deeply($q->{sql}, \" AND ts >= $t0", 'SINCE SQL');
         $q = $parse->("FROM z $s");
-        is($q->{xap}, qq{f:"z" ts:$t0..}, 'SINCE Xapian');
+        is($q->{xap}, qq{f:"z" rt:$t0..}, 'SINCE Xapian');
 
         $q = $parse->($s = qq{ON 2-Oct-1993});
         is_deeply($q->{sql}, \" AND ts >= $t0 AND ts <= $t1", 'ON SQL');
         $q = $parse->("FROM z $s");
-        is($q->{xap}, qq{f:"z" ts:$t0..$t1}, 'ON Xapian');
+        is($q->{xap}, qq{f:"z" rt:$t0..$t1}, 'ON Xapian');
 }
 
 {