From 5ff0ab94e364fa37cd45d636d76940a8c50c58d0 Mon Sep 17 00:00:00 2001 From: Thomas Hilaire Date: Mon, 7 Dec 2015 11:48:11 +0100 Subject: [PATCH] fix destroy, folderdata is not an array --- JMAP/ImapDB.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/JMAP/ImapDB.pm b/JMAP/ImapDB.pm index 99e3002..3e4cf03 100644 --- a/JMAP/ImapDB.pm +++ b/JMAP/ImapDB.pm @@ -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}}; }