aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2015-07-24 17:00:26 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-07-24 17:35:29 +0200
commit59686220211905705b04e571008c6dedecf6243f (patch)
treee7b8f5a0518aea975d4e2cc4e1d3f88e018e9b99
parentb2beb8ab9149ea4a4977209160ab8a9f15f05ab7 (diff)
wibble
-rwxr-xr-ximapsync16
-rw-r--r--lib/Net/IMAP/Sync.pm7
2 files changed, 12 insertions, 11 deletions
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;