Skip to content
Snippets Groups Projects
Commit 8c7dec35 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Search forward/backward by subjet without "re:"/"re: " prefix

The search seems to be backward by default (at least when listing a
sub-board), so should look into that. But at least now you can find
replies that include a "re:" prefix easily.

Searching by thread should be added too.
parent 73bb5110
No related branches found
No related tags found
No related merge requests found
Pipeline #6001 passed
......@@ -637,11 +637,26 @@ function get_msg_lines(msgbase, msg, hdr, source, hex, wrap, chop)
return text;
}
function prop_val(msg, prop)
{
var val = msg[prop].toLowerCase();
if(prop === 'subject') {
while(val.slice(0, 3) == 're:') {
val = val.slice(3);
while(val.slice(0, 1) == ' ')
val = val.slice(1);
}
}
return val;
}
function next_msg(list, current, prop)
{
const val = prop_val(list[current], prop);
var next = current + 1;
while(next < list.length) {
if(list[next][prop].toLowerCase() == list[current][prop].toLowerCase())
if(prop_val(list[next], prop) == val)
break;
next++;
}
......@@ -653,9 +668,10 @@ function next_msg(list, current, prop)
function prev_msg(list, current, prop)
{
const val = prop_val(list[current], prop);
var prev = current - 1;
while(prev >= 0) {
if(list[prev][prop].toLowerCase() == list[current][prop].toLowerCase())
if(prop_val(list[prev], prop) == val)
break;
prev--;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment