X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/blobdiff_plain/2931223071f48e8a92e9a2353694ef534a44d295..e3f196ec3b0278acf9601baeae997ab8218e7926:/twirssi.pl?ds=inline diff --git a/twirssi.pl b/twirssi.pl index 1f0f895..a52823f 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -910,7 +910,9 @@ sub do_updates { printf $fh "id:%u account:%s type:last_id timeline\n", $new_poll_id, $username; - print scalar localtime, " - Polling for replies" if &debug; + print scalar localtime, " - Polling for replies since ", + $id_map{__last_id}{$username}{reply} + if &debug; $new_poll_id = 0; eval { if ( $id_map{__last_id}{$username}{reply} ) @@ -1032,7 +1034,7 @@ sub monitor_child { # pretend if ( open FILE, $filename ) { - bindmode FILE, ":utf8"; + binmode FILE, ":utf8"; my @lines; my %new_cache; while () { @@ -1163,8 +1165,16 @@ sub monitor_child { } if (/^-- (\d+)$/) { - ($new_last_poll) = ($1); - last; + $new_last_poll = $1; + if ( $new_last_poll >= $last_poll ) { + last; + } else { + print "Impossible! ", + "new_last_poll=$new_last_poll < last_poll=$last_poll!" + if &debug; + undef $new_last_poll; + next; + } } my ( $f, $t ) = split ' ', $_; $nicks{$f} = $friends{$f} = $t;