From e1bafc13858b5c72a7584c52d3d9d6d597d39e6b Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Tue, 31 Aug 2021 20:23:03 +0200 Subject: restructured ipc format --- lib/JWebmail/Model/Driver/MockJSON.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/JWebmail/Model/Driver/MockJSON.pm') diff --git a/lib/JWebmail/Model/Driver/MockJSON.pm b/lib/JWebmail/Model/Driver/MockJSON.pm index aafc74d..258246d 100644 --- a/lib/JWebmail/Model/Driver/MockJSON.pm +++ b/lib/JWebmail/Model/Driver/MockJSON.pm @@ -62,9 +62,8 @@ sub communicate { my $s = sub { my $sort_by = $args{args}->[LIST_SORT]; my $rev = $sort_by !~ m/^![[:lower:]]+/ ? 1 : -1; - $sort_by =~ s/!//; - $sort_by = "date_received" if $sort_by eq "date"; - return ($a->{$sort_by} cmp $b->{$sort_by}) * $rev; + $sort_by =~ s/^!//; + return (($a->{$sort_by}||$a->{head}{$sort_by}) cmp ($b->{$sort_by}||$b->{head}{$sort_by})) * $rev; }; return ([sort { &$s } @{ $self->list_reply }[$args{args}->[LIST_START]..$args{args}->[LIST_END]]], 0); } -- cgit v1.2.3