Commit Diff
Diff:
6240f9b84ab152b622940a098379f74513e170a3
debcbab21044d4ed53603bc14f0532ba6b3ba0b5
Commit:
debcbab21044d4ed53603bc14f0532ba6b3ba0b5
Tree:
e00d74131770b6f6818790b81d7d9f87dbaa2cb9
Author:
Omar Polo <op@omarpolo.com>
Date:
Tue Sep 13 20:14:58 2022 UTC
Message:
mkindex: show the latest date/sender per thread
commit - 6240f9b84ab152b622940a098379f74513e170a3
commit + debcbab21044d4ed53603bc14f0532ba6b3ba0b5
blob - 23a471248e697b6a326de2aedfff857e105ee153
blob + 5a543bbae24d8d5c7b11e208fe99d887809b228e
--- mkindex
+++ mkindex
@@ -28,7 +28,13 @@ my $last_level = 0;
my $from_day;
my $to_day;
my $threads_seen = 0;
+
my $last_level = 0;
+my $last_tid;
+my $last_date;
+my $last_from;
+my $last_subj;
+
my $threads = 0;
my $threads_per_page = 100;
@@ -152,6 +158,12 @@ sub thread_entry {
print $fh "</li>\n";
}
+sub index_entry {
+ my ($fh, $mid, $date, $from, $subj) = @_;
+
+ entry $fh, "thread", $mid, $date, $from, $subj;
+}
+
sub thread_entry {
my ($fh, $mid, $level, $date, $from, $subj) = @_;
@@ -189,15 +201,24 @@ while (<>) {
my $day = $date =~ s/ .*//r;
$to_day = mins $day, $to_day;
$from_day = maxs $day, $from_day;
-
- entry $pfh, "thread", $mid, $date, $from, $subj;
}
thread_entry $tfh, $mid, $level, $date, $from, $subj;
$last_level = $level;
$threads_seen = 1;
+
+ index_entry $pfh, $last_tid, $last_date, $last_from, $last_subj
+ if defined $last_tid && $level == 0;
+
+ $last_tid = $mid if $level == 0;
+ $last_date = $date;
+ $last_from = $from;
+ $last_subj = $subj if $level == 0;
}
+index_entry $pfh, $last_tid, $last_date, $last_from, $last_subj
+ if defined $last_tid;
+
endfile;
endthread if $threads_seen;
renderpages;
Omar Polo