summaryrefslogtreecommitdiff
path: root/lib/JWebmail/Model/Driver/MockJSON.pm
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de>2021-08-31 20:23:03 +0200
committerJannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de>2021-08-31 20:23:03 +0200
commite1bafc13858b5c72a7584c52d3d9d6d597d39e6b (patch)
treeb7135f6c08ab43a97ab2e5fce896b470461829bd /lib/JWebmail/Model/Driver/MockJSON.pm
parent1e1eabaac06721ee0d686d10a6effa9a3450a1ca (diff)
restructured ipc format
Diffstat (limited to 'lib/JWebmail/Model/Driver/MockJSON.pm')
-rw-r--r--lib/JWebmail/Model/Driver/MockJSON.pm5
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);
}