summaryrefslogtreecommitdiff
path: root/lib/JWebmail/Model
diff options
context:
space:
mode:
Diffstat (limited to 'lib/JWebmail/Model')
-rw-r--r--lib/JWebmail/Model/Driver/MockJSON.pm11
-rw-r--r--lib/JWebmail/Model/ReadMails.pm2
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/JWebmail/Model/Driver/MockJSON.pm b/lib/JWebmail/Model/Driver/MockJSON.pm
index 99df346..aafc74d 100644
--- a/lib/JWebmail/Model/Driver/MockJSON.pm
+++ b/lib/JWebmail/Model/Driver/MockJSON.pm
@@ -8,15 +8,15 @@ use Mojo::JSON qw(decode_json);
use constant {
- VALID_USER => 'me@mockjson.com',
+ VALID_USER => 'mockjson@example.com',
VALID_PW => 'vwxyz',
};
use constant {
- LIST_START => 0,
- LIST_END => 1,
- LIST_SORT => 2,
- LIST_FOLDER => 3,
+ LIST_START => 0,
+ LIST_END => 1,
+ LIST_SORT => 2,
+ LIST_FOLDER => 3,
};
sub _read_json_file {
@@ -63,6 +63,7 @@ sub communicate {
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;
};
return ([sort { &$s } @{ $self->list_reply }[$args{args}->[LIST_START]..$args{args}->[LIST_END]]], 0);
diff --git a/lib/JWebmail/Model/ReadMails.pm b/lib/JWebmail/Model/ReadMails.pm
index ddca7ce..e541de1 100644
--- a/lib/JWebmail/Model/ReadMails.pm
+++ b/lib/JWebmail/Model/ReadMails.pm
@@ -138,7 +138,7 @@ __END__
=head1 NAME
-ReadMails - Read recieved mails
+ReadMails - Read received mails
=head1 SYNOPSIS