diff options
Diffstat (limited to 'lib/JWebmail/Model')
-rw-r--r-- | lib/JWebmail/Model/ReadMails/QMailAuthuser.pm | 18 | ||||
-rw-r--r-- | lib/JWebmail/Model/ReadMails/Role.pm | 7 |
2 files changed, 19 insertions, 6 deletions
diff --git a/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm b/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm index 5190e26..f5f9392 100644 --- a/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm +++ b/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm @@ -170,6 +170,14 @@ sub move { return 1; } +sub remove { + my $self = shift; + my ($auth, $folder, $mid) = @_; + + my $_resp = $self->build_and_run($auth, 'remove', [$folder, $mid]); + return 1; +} + sub build_arg { my $self = shift; @@ -235,8 +243,8 @@ sub read_qmauth { $resp = { head => $r, body => $buf, - rc => $?, - e => $e, + rc => $?, + e => $e, }; } elsif ($rs == 3 << 8 || $rs == 0) { @@ -244,9 +252,9 @@ sub read_qmauth { eval { $resp = decode_json $input if $input; 1 } or do { $resp = { - info => "error decoding response", - response => $input, - cause => $@, + info => "error decoding response", + response => $input, + cause => $@, return_code => $rc, }; }; diff --git a/lib/JWebmail/Model/ReadMails/Role.pm b/lib/JWebmail/Model/ReadMails/Role.pm index f094190..dfccbde 100644 --- a/lib/JWebmail/Model/ReadMails/Role.pm +++ b/lib/JWebmail/Model/ReadMails/Role.pm @@ -43,6 +43,7 @@ my @methods = ( 'search', 'show', 'raw', + 'remove', ); requires(@methods); @@ -127,7 +128,11 @@ List all mailbox sub folders. =head2 move -Move mails between folders. +Move a mail between folders. + +=head2 remove + +Mark a mail to be moved to the trash. =head2 Auth |