Fixed latest 2 direct messages not actually loading in initial load of timeline.

This commit is contained in:
Storm Dragon
2025-07-31 02:10:50 -04:00
parent 1e74d9ab69
commit 5886da8f49
+17 -13
View File
@@ -6615,19 +6615,23 @@ sub dmrefresh {
my $last_status_id = $j->{'last_status'}->{'id'} || $j->{'last_status'}->{'id_str'}; my $last_status_id = $j->{'last_status'}->{'id'} || $j->{'last_status'}->{'id_str'};
my $tracking_key = "${conversation_id}:${last_status_id}"; my $tracking_key = "${conversation_id}:${last_status_id}";
print $stdout "-- DEBUG: DM #$i unread flag: " . ($is_unread ? "true" : "false") . ", tracking_key: $tracking_key\n" if ($verbose); print $stdout "-- DEBUG: DM #$i unread flag: " . ($is_unread ? "true" : "false") . ", tracking_key: $tracking_key, dm_first_time: " . ($dm_first_time ? "true" : "false") . "\n" if ($verbose);
# Check if we've already seen this exact conversation+status combination # During first-time initialization, show the most recent DMs regardless of seen status
if ($dm_seen_status{$tracking_key}) { if (!$dm_first_time) {
print $stdout "-- DEBUG: Skipping DM #$i - already seen locally (key: $tracking_key)\n" if ($verbose); # Check if we've already seen this exact conversation+status combination
next; if ($dm_seen_status{$tracking_key}) {
} print $stdout "-- DEBUG: Skipping DM #$i - already seen locally (key: $tracking_key)\n" if ($verbose);
next;
# For servers that support unread flag, also check that }
# But skip this check during first-time initialization to ensure DMs are shown
if (!$is_unread && !$dm_seen_status{$tracking_key} && !$dm_first_time) { # For servers that support unread flag, also check that
print $stdout "-- DEBUG: Skipping DM #$i - already read (unread=false)\n" if ($verbose); if (!$is_unread) {
next; print $stdout "-- DEBUG: Skipping DM #$i - already read (unread=false)\n" if ($verbose);
next;
}
} else {
print $stdout "-- DEBUG: First-time initialization - showing DM #$i regardless of seen/unread status\n" if ($verbose);
} }
# Only play sound for the first unread conversation to avoid spam # Only play sound for the first unread conversation to avoid spam
@@ -7632,7 +7636,7 @@ sub standarddm {
my ($time, $ts) = &$wraptime($ref->{'last_status'}->{'created_at'}); my ($time, $ts) = &$wraptime($ref->{'last_status'}->{'created_at'});
my $text = &descape(&html_to_text($ref->{'last_status'}->{'content'})); my $text = &descape(&html_to_text($ref->{'last_status'}->{'content'}));
my $sns = &descape($ref->{'last_status'}->{'account'}->{'username'} || $ref->{'last_status'}->{'account'}->{'acct'}); my $sns = &descape($ref->{'last_status'}->{'account'}->{'acct'} || $ref->{'last_status'}->{'account'}->{'username'});
# Add relative time for DMs # Add relative time for DMs
my $relative_time = &format_relative_time($ref->{'last_status'}->{'created_at'}); my $relative_time = &format_relative_time($ref->{'last_status'}->{'created_at'});