From: Guilhem Moulin Date: Fri, 24 Jul 2015 15:00:26 +0000 (+0200) Subject: wibble X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=59686220211905705b04e571008c6dedecf6243f;p=interimap.git wibble --- diff --git a/imapsync b/imapsync index ea6c4e8..6fb82ab 100755 --- a/imapsync +++ b/imapsync @@ -645,14 +645,14 @@ sub check($$$$$) { } elsif (!defined $lList->{$lUID}) { unless ($lVanished{$lUID}) { - warn "WARNING: local($mailbox): No match for remote UID $rUID. Downloading again...\n"; + warn "local($mailbox): WARNING: No match for remote UID $rUID. Downloading again...\n"; push @{$missing{remote}}, $rUID; delete $rList->{$rUID}; } } elsif (!defined $rList->{$rUID}) { unless ($rVanished{$rUID}) { - warn "WARNING: remote($mailbox): No match for local UID $lUID. Downloading again...\n"; + warn "remote($mailbox): WARNING: No match for local UID $lUID. Downloading again...\n"; push @{$missing{local}}, $lUID; delete $lList->{$lUID}; } @@ -707,7 +707,7 @@ sub sync_known_messages($$) { my ($rUID) = $STH_GET_REMOTE_UID->fetchrow_array(); die if defined $STH_GET_REMOTE_UID->fetchrow_arrayref(); # sanity check if (!defined $rUID) { - warn "WARNING: remote($mailbox): No match for local vanished UID $lUID. Ignoring...\n"; + warn "remote($mailbox): WARNING: No match for local vanished UID $lUID. Ignoring...\n"; } elsif (!exists $rVanished{$rUID}) { push @rToRemove, $rUID; @@ -718,7 +718,7 @@ sub sync_known_messages($$) { my ($lUID) = $STH_GET_LOCAL_UID->fetchrow_array(); die if defined $STH_GET_LOCAL_UID->fetchrow_arrayref(); # sanity check if (!defined $lUID) { - warn "WARNING: local($mailbox): No match for remote vanished UID $rUID. Ignoring...\n"; + warn "local($mailbox): WARNING: No match for remote vanished UID $rUID. Ignoring...\n"; } elsif (!exists $lVanished{$lUID}) { push @lToRemove, $lUID; @@ -755,15 +755,15 @@ sub sync_known_messages($$) { my ($rUID) = $STH_GET_REMOTE_UID->fetchrow_array(); die if defined $STH_GET_REMOTE_UID->fetchrow_arrayref(); # sanity check if (!defined $rUID) { - warn "WARNING: remote($mailbox): No match for local updated UID $lUID. Downloading again...\n"; + warn "remote($mailbox): WARNING: No match for local updated UID $lUID. Downloading again...\n"; push @{$missing{local}}, $lUID; } elsif (defined (my $rFlags = $rModified->{$rUID})) { unless ($lFlags eq $rFlags) { my %flags = map {$_ => 1} (split(/ /, $lFlags), split(/ /, $rFlags)); my $flags = join ' ', sort(keys %flags); - warn "WARNING: Conflicting FLAG update for lUID $lUID ($lFlags) and". - "rUID $rUID ($rFlags). Setting both to the union ($flags).\n"; + warn "WARNING: Conflicting flag update in $mailbox for local UID $lUID ($lFlags) ". + "and remote UID $rUID ($rFlags). Setting both to the union ($flags).\n"; $lToUpdate{$flags} //= []; push @{$lToUpdate{$flags}}, $lUID; $rToUpdate{$flags} //= []; @@ -780,7 +780,7 @@ sub sync_known_messages($$) { my ($lUID) = $STH_GET_LOCAL_UID->fetchrow_array(); die if defined $STH_GET_LOCAL_UID->fetchrow_arrayref(); # sanity check if (!defined $lUID) { - warn "WARNING: local($mailbox): No match for remote updated UID $rUID. Downloading again...\n"; + warn "local($mailbox): WARNING: No match for remote updated UID $rUID. Downloading again...\n"; push @{$missing{remote}}, $rUID; } elsif (!exists $lModified->{$lUID}) { diff --git a/lib/Net/IMAP/Sync.pm b/lib/Net/IMAP/Sync.pm index b864db8..1aceb70 100644 --- a/lib/Net/IMAP/Sync.pm +++ b/lib/Net/IMAP/Sync.pm @@ -600,7 +600,8 @@ sub remove($@) { delete @{$self->{_MODIFIED}}{@expunged}; $self->{_VANISHED} = [ keys %vanished ]; - $self->log("Removed UID ".compact_set(@expunged)) if @expunged and !$self->{quiet}; + $self->log("Removed ".($#expunged+1)." message(s), ". + "UID ".compact_set(@expunged)) if @expunged and !$self->{quiet}; $self->warn("Could not UID EXPUNGE ".compact_set(@failed)) if @failed; return @failed; } @@ -795,8 +796,8 @@ sub get_cache($@) { unless $self->{_STATE} eq 'SELECTED'; my $mailbox = $self->{_SELECTED} // $self->panic(); - $self->fail("Pending VANISHED responses!") if @{$self->{_VANISHED}}; - $self->fail("Pending FLAG updates!") if %{$self->{_MODIFIED}}; + $self->panic("Pending VANISHED responses!") if @{$self->{_VANISHED}}; + $self->panic("Pending FLAG updates!") if %{$self->{_MODIFIED}}; my $cache = $self->{_PCACHE}->{$mailbox}; return @_ ? @$cache{@_} : %$cache;