}
-
-# 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;
if (--$timeout == 0) {
$lIMAP->noop();
$rIMAP->noop();
+ # might have got updates so exit the loop
}
}
}
$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};
}