From 5182be15c4e86550304082df89296b453976538b Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 26 Jul 2025 12:17:38 -0400 Subject: [PATCH] Reorganized how timeline entries are shown. I like the new format much better. The metadata line is separte from the text of the post. This is nice, because there's more stuff to show these days instead of how it was back in Twitter. --- ttyverse.pl | 66 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/ttyverse.pl b/ttyverse.pl index b5a89d5..8b0fec4 100755 --- a/ttyverse.pl +++ b/ttyverse.pl @@ -5975,17 +5975,6 @@ sub standardpost { print $stdout "-- DEBUG: standardpost - user: '$sn', text: '$post', boost_attribution: '" . $ref->{'boost_attribution'} . "'\n" if ($verbose); } - # Add boost attribution if this is a boosted post - if (exists($ref->{'boost_attribution'}) && $ref->{'boost_attribution'}) { - my $booster = &descape($ref->{'boost_attribution'}); - $post = "[boosted $booster] $post"; - } - - # Add poll information if this post has a poll - if (exists($ref->{'poll'}) && $ref->{'poll'}) { - my $poll_info = &format_poll_display($ref->{'poll'}); - $post .= "\n$poll_info" if ($poll_info); - } my $colour; my $g; my $h; @@ -6012,25 +6001,42 @@ sub standardpost { $sn = "($ref->{'tag'}->{'payload'})$sn" if (length($ref->{'tag'}->{'payload'}) && $ref->{'tag'}->{'type'} eq 'list'); - $post = "<$sn> $post"; - # fediverse doesn't always do this right. - $h = $ref->{'reblogs_count'}; $h += 0; #$h = "${h}+" if ($h >= 100); - # fediverse doesn't always handle single reposts right. good f'n grief. - $post = "(x${h}) $post" if ($h > 1 && !$noreblogs); - # br3nda's modified timestamp patch - if ($timestamp) { - my ($time, $ts) = &$wraptime($ref->{'created_at'}); - $post = "[$ts] $post"; + + # Build the metadata/info line: [boost] (time) via client + my $info_line = "<$sn>"; + + # Add boost attribution if this is a boosted post + if (exists($ref->{'boost_attribution'}) && $ref->{'boost_attribution'}) { + my $booster = &descape($ref->{'boost_attribution'}); + $info_line .= " [boosted $booster]"; } # Add relative time and client info my $relative_time = &format_relative_time($ref->{'created_at'}); my $client_info = &format_client_info($ref); - my $metadata = ''; - $metadata .= " ($relative_time)" if ($relative_time); - $metadata .= " via $client_info" if ($client_info); - $post .= $metadata if ($metadata); + $info_line .= " ($relative_time)" if ($relative_time); + $info_line .= " via $client_info" if ($client_info); + + # fediverse doesn't always do this right. + $h = $ref->{'reblogs_count'}; $h += 0; #$h = "${h}+" if ($h >= 100); + # fediverse doesn't always handle single reposts right. good f'n grief. + $info_line = "(x${h}) $info_line" if ($h > 1 && !$noreblogs); + + # br3nda's modified timestamp patch (absolute timestamp) + if ($timestamp) { + my ($time, $ts) = &$wraptime($ref->{'created_at'}); + $info_line = "[$ts] $info_line"; + } + + # Combine info line + content with newline separation + $post = $info_line . "\n" . $post; + + # Add poll information if this post has a poll + if (exists($ref->{'poll'}) && $ref->{'poll'}) { + my $poll_info = &format_poll_display($ref->{'poll'}); + $post .= "\n$poll_info" if ($poll_info); + } # pull it all together $post = &wwrap($post, ($wrapseq <= 1) ? ((&$prompt(1))[1]) : 0) @@ -6198,8 +6204,16 @@ sub standarddm { my ($time, $ts) = &$wraptime($ref->{'last_status'}->{'created_at'}); my $text = &descape(&html_to_text($ref->{'last_status'}->{'content'})); my $sns = &descape($ref->{'last_status'}->{'account'}->{'username'} || $ref->{'last_status'}->{'account'}->{'acct'}); - my $g = &wwrap("[DM d$ref->{'menu_select'}]". - "[$sns/$ts] $text", ($wrapseq <= 1) ? ((&$prompt(1))[1]) : 0); + + # Add relative time for DMs + my $relative_time = &format_relative_time($ref->{'last_status'}->{'created_at'}); + + # Build DM info line: [DM code][user/timestamp] (relative_time) + my $dm_info = "[DM d$ref->{'menu_select'}][$sns/$ts]"; + $dm_info .= " ($relative_time)" if ($relative_time); + + # Combine info line + content with newline (new two-line format) + my $g = &wwrap($dm_info . "\n" . $text, ($wrapseq <= 1) ? ((&$prompt(1))[1]) : 0); $g =~ s/^\[DM ([^\/]+)\//${CCdm}[DM ${EM}\1${OFF}${CCdm}\// unless ($nocolour);