From faa472ccd478bcb900ae6e34e2cb1f6b29a30512 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Thu, 23 Jul 2015 17:10:34 +0200 Subject: wibble --- imapsync | 6 +++--- lib/Net/IMAP/Sync.pm | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/imapsync b/imapsync index 5be570e..4ef47b3 100755 --- a/imapsync +++ b/imapsync @@ -752,9 +752,8 @@ sub sync_messages($$) { } - -# Wait for notifications on either IMAP server, up to $timout. Then -# issue a NOOP so the connection doesn't terminate for inactivity. +# Wait up to $timout seconds for notifications on either IMAP server. +# Then issue a NOOP so the connection doesn't terminate for inactivity. sub wait_notifications(;$) { my $timeout = shift // 300; @@ -767,6 +766,7 @@ sub wait_notifications(;$) { if (--$timeout == 0) { $lIMAP->noop(); $rIMAP->noop(); + # might have got updates so exit the loop } } } diff --git a/lib/Net/IMAP/Sync.pm b/lib/Net/IMAP/Sync.pm index ad7b2f5..2116443 100644 --- a/lib/Net/IMAP/Sync.pm +++ b/lib/Net/IMAP/Sync.pm @@ -844,12 +844,12 @@ sub pull_updates($) { $self->_send("UID FETCH ".compact_set(@missing)." (MODSEQ FLAGS)") if @missing; @missing = (); } - + # do that afterwards since the UID FETCH command above can produce VANISHED responses my %vanished = map {$_ => 1} @{$self->{_VANISHED}}; @vanished = keys %vanished; $self->{_VANISHED} = []; - + # ignore FLAG updates on VANISHED messages delete @modified{@vanished}; } -- cgit v1.2.3