diff options
author | Jannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de> | 2021-08-31 20:23:03 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de> | 2021-08-31 20:23:03 +0200 |
commit | e1bafc13858b5c72a7584c52d3d9d6d597d39e6b (patch) | |
tree | b7135f6c08ab43a97ab2e5fce896b470461829bd /lib/JWebmail/Model/Driver/MockJSON.pm | |
parent | 1e1eabaac06721ee0d686d10a6effa9a3450a1ca (diff) |
restructured ipc format
Diffstat (limited to 'lib/JWebmail/Model/Driver/MockJSON.pm')
-rw-r--r-- | lib/JWebmail/Model/Driver/MockJSON.pm | 5 |
1 files changed, 2 insertions, 3 deletions
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); } |