user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] view: remove attribution for topics in top-level view
Date: Thu,  8 Oct 2015 01:00:10 +0000	[thread overview]
Message-ID: <20151008010010.17017-1-e@80x24.org> (raw)

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


             reply	other threads:[~2015-10-08  1:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08  1:00 Eric Wong [this message]
2015-10-09 18:55 ` [PATCH 2/1] view: fixup bad comparison Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151008010010.17017-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).