diff --git a/ttyverse.pl b/ttyverse.pl index c7b74ea..a368852 100755 --- a/ttyverse.pl +++ b/ttyverse.pl @@ -6608,8 +6608,8 @@ sub dmrefresh { next; } - # For background refresh (interactive=0), use unread flag detection with local tracking fallback - if (!$interactive && !$sent_dm) { + # For background refresh (interactive=0) OR first-time initialization, use unread flag detection with local tracking fallback + if ((!$interactive && !$sent_dm) || $dm_first_time) { my $is_unread = $j->{'unread'} || 0; my $conversation_id = $j->{'id'}; my $last_status_id = $j->{'last_status'}->{'id'} || $j->{'last_status'}->{'id_str'}; @@ -6624,7 +6624,8 @@ sub dmrefresh { } # For servers that support unread flag, also check that - if (!$is_unread && !$dm_seen_status{$tracking_key}) { + # But skip this check during first-time initialization to ensure DMs are shown + if (!$is_unread && !$dm_seen_status{$tracking_key} && !$dm_first_time) { print $stdout "-- DEBUG: Skipping DM #$i - already read (unread=false)\n" if ($verbose); next; }