user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] view: remove attribution for topics in top-level view
@ 2015-10-08  1:00 Eric Wong
  2015-10-09 18:55 ` [PATCH 2/1] view: fixup bad comparison Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2015-10-08  1:00 UTC (permalink / raw)
  To: meta

It clutters up the page unnecessarily, as identity of the topic
starter/updater probably doesn't matter if there's no exact
message to attribute the message to.
---
 lib/PublicInbox/View.pm | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index beb9989..534b553 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -823,11 +823,10 @@ sub add_topic {
 
 		my $mid = mid_clean($x->header('Message-ID'));
 
-		my $u = $x->header('X-PI-From');
 		my $ts = $x->header('X-PI-TS');
 		my $exist = $state->{latest}->{$topic};
 		if (!$exist || $exist->[2] < $ts) {
-			$state->{latest}->{$topic} = [ $mid, $u, $ts ];
+			$state->{latest}->{$topic} = [ $mid, $ts ];
 		}
 	} else {
 		# ghost message, do not bump level
@@ -851,10 +850,9 @@ sub dump_topics {
 	while (defined(my $info = shift @$order)) {
 		my ($level, $subj, $topic) = @$info;
 		my $n = delete $subjs->{$topic};
-		my ($mid, $u, $ts) = @{delete $latest->{$topic}};
+		my ($mid, $ts) = @{delete $latest->{$topic}};
 		$mid = PublicInbox::Hval->new($mid)->as_href;
 		$subj = PublicInbox::Hval->new($subj)->as_html;
-		$u = PublicInbox::Hval->new($u)->as_html;
 		$pfx = INDENT x ($level - 1);
 		my $nl = $level == $prev ? "\n" : '';
 		my $dot = $level == 0 ? '' : '` ';
@@ -863,13 +861,13 @@ sub dump_topics {
 		my $attr;
 		$ts = POSIX::strftime('%Y-%m-%d %H:%M', gmtime($ts));
 		if ($n == 1) {
-			$attr = "created by $u @ $ts UTC";
+			$attr = "created @ $ts UTC";
 			$n = "";
 		} else {
 			# $n isn't the total number of posts on the topic,
 			# just the number of posts in the current results
 			# window, so leave it unlabeled
-			$attr = "updated by $u @ $ts UTC";
+			$attr = "updated @ $ts UTC";
 			$n = " ($n)";
 		}
 		if ($level == 0 || $attr ne $prev_attr) {
-- 
EW


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/1] view: fixup bad comparison
  2015-10-08  1:00 [PATCH] view: remove attribution for topics in top-level view Eric Wong
@ 2015-10-09 18:55 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2015-10-09 18:55 UTC (permalink / raw)
  To: meta

Oops, there is no longer a 3rd element.

Fixes: 759efc037728a766ee80f1b0d3c1fd7b8c76a05f
("view: remove attribution for topics in top-level view")
---
 lib/PublicInbox/View.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 534b553..48c4553 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -825,7 +825,7 @@ sub add_topic {
 
 		my $ts = $x->header('X-PI-TS');
 		my $exist = $state->{latest}->{$topic};
-		if (!$exist || $exist->[2] < $ts) {
+		if (!$exist || $exist->[1] < $ts) {
 			$state->{latest}->{$topic} = [ $mid, $ts ];
 		}
 	} else {
-- 
EW


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-09 18:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-08  1:00 [PATCH] view: remove attribution for topics in top-level view Eric Wong
2015-10-09 18:55 ` [PATCH 2/1] view: fixup bad comparison Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).