diff options
author | dakkar <dakkar@thenautilus.net> | 2019-04-29 15:42:32 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2019-04-29 15:42:32 +0100 |
commit | db2394b8c0beba5f4323dffe2d20adad1c5acf2b (patch) | |
tree | 9631d5179189c5a254edcd526c812a841b4c7acc /lib/Sietima/Role/SubscriberOnly/Moderate.pm | |
parent | v1.0.4 (diff) | |
download | Sietima-db2394b8c0beba5f4323dffe2d20adad1c5acf2b.tar.gz Sietima-db2394b8c0beba5f4323dffe2d20adad1c5acf2b.tar.bz2 Sietima-db2394b8c0beba5f4323dffe2d20adad1c5acf2b.zip |
actually fix the cmd line problem
Diffstat (limited to 'lib/Sietima/Role/SubscriberOnly/Moderate.pm')
-rw-r--r-- | lib/Sietima/Role/SubscriberOnly/Moderate.pm | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/lib/Sietima/Role/SubscriberOnly/Moderate.pm b/lib/Sietima/Role/SubscriberOnly/Moderate.pm index c4d62c9..e7fbb7b 100644 --- a/lib/Sietima/Role/SubscriberOnly/Moderate.pm +++ b/lib/Sietima/Role/SubscriberOnly/Moderate.pm @@ -147,6 +147,39 @@ sub show_mail_from_moderation_queue ($self,$runner,@) { $runner->out($mail->as_string =~ s{\r\n}{\n}gr); } +=method C<resume_mail_from_moderation_queue> + + $sietima->resume_mail_from_moderation_queue($sietima_runner); + +This method L<retrieves the email|Sietima::MailStore/retrieve_by_id> +of the message requested from the command line, and L<resumes|/resume> +it. + +This method is usually invoked from the command line, see L<< +/C<command_line_spec> >>. + +=cut + +sub resume_mail_from_moderation_queue ($self,$runner,@) { + $self->resume($runner->parameters->{'mail-id'}); +} + +=method C<drop_mail_from_moderation_queue> + + $sietima->drop_mail_from_moderation_queue($sietima_runner); + +This method L<retrieves the email|Sietima::MailStore/retrieve_by_id> +of the message requested from the command line, and L<drops|/drop> it. + +This method is usually invoked from the command line, see L<< +/C<command_line_spec> >>. + +=cut + +sub drop_mail_from_moderation_queue ($self,$runner,@) { + $self->drop($runner->parameters->{'mail-id'}); +} + =modif C<command_line_spec> This method adds the following sub-commands for the command line: @@ -219,15 +252,11 @@ around command_line_spec => sub ($orig,$self) { $etc->('show'), }; $spec->{subcommands}{'resume-held'} = { - op => sub ($self,$runner,$args) { - $self->resume($runner->parameters->{'mail-id'}); - }, + op => 'resume_mail_from_moderation_queue', $etc->('resume'), }; $spec->{subcommands}{'drop-held'} = { - op => sub ($self,$runner,$args) { - $self->drop($runner->parameters->{'mail-id'}); - }, + op => 'drop_mail_from_moderation_queue', $etc->('drop'), }; |