Skip to content

Commit

Permalink
Merge pull request jmapio#2 from thomas-hilaire/docker
Browse files Browse the repository at this point in the history
fix destroy, folderdata is not an array
  • Loading branch information
Romain Pignolet committed Dec 10, 2015
2 parents 943b4fd + 5ff0ab9 commit 4332fe7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions JMAP/ImapDB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1149,16 +1149,15 @@ sub destroy_messages {
}

my $folderdata = $Self->dget('ifolders');
my %foldermap = map { $_->[0] => $_ } @$folderdata;
my %jmailmap = map { $_->[4] => $_ } grep { $_->[4] } @$folderdata;
my %foldermap = map { $_->{ifolderid} => $_ } @$folderdata;

$Self->commit();

my @destroyed;
foreach my $ifolderid (keys %destroymap) {
# XXX - merge similar actions?
my $imapname = $foldermap{$ifolderid}[1];
my $uidvalidity = $foldermap{$ifolderid}[2];
my $imapname = $foldermap{$ifolderid}{imapname};
my $uidvalidity = $foldermap{$ifolderid}{uidvalidity};
unless ($imapname) {
$notdestroyed{$_} = {type => 'notFound', description => "No folder"} for values %{$destroymap{$ifolderid}};
}
Expand Down

0 comments on commit 4332fe7

Please sign in to comment.