]> git.g-eek.se Git - interimap.git/commitdiff
Net::IMAP::InterIMAP optimisation: ignore a new message that's immediately expunged
authorGuilhem Moulin <guilhem@fripost.org>
Fri, 11 Mar 2016 23:50:26 +0000 (00:50 +0100)
committerGuilhem Moulin <guilhem@fripost.org>
Fri, 11 Mar 2016 23:50:30 +0000 (00:50 +0100)
(before we had a chance to sync it)

lib/Net/IMAP/InterIMAP.pm

index cdc5697aef2c6067aa17916a329f8809787607f2..1686448bb571e17abf5534571f8bf5519706cfa2 100644 (file)
@@ -2250,6 +2250,8 @@ sub _resp($$;&$$) {
                 $self->panic("$1 <= $cache->{EXISTS}") if $1 <= $cache->{EXISTS}; # sanity check
                 $self->fail("RFC 7162 violation!  Got an EXPUNGE response with QRESYNC enabled.");
             }
+            # the new message was expunged before it was synced
+            $self->{_NEW} = 0 if $self->{_NEW} == 1 and $cache->{EXISTS} == $1;
             $cache->{EXISTS}--; # explicit EXISTS responses are optional
         }
         elsif (/\ASEARCH((?: [0-9]+)*)\z/) {