diff options
-rw-r--r-- | lib/Sietima/CmdLine.pm | 6 | ||||
-rw-r--r-- | lib/Sietima/Role/SubscriberOnly/Moderate.pm | 41 |
2 files changed, 39 insertions, 8 deletions
diff --git a/lib/Sietima/CmdLine.pm b/lib/Sietima/CmdLine.pm index b636533..180d3dd 100644 --- a/lib/Sietima/CmdLine.pm +++ b/lib/Sietima/CmdLine.pm @@ -114,6 +114,10 @@ sub _build_app_spec($self) { return App::Spec->read({ $spec_data->%*, $self->extra_spec->%*, + + # App::Spec 0.005 really wants a class name, even when we pass + # a pre-build cmd object to the Runner + class => ref($self->sietima), }); } @@ -141,8 +145,6 @@ sub _build_runner($self) { return Sietima::Runner->new({ spec => $self->app_spec, cmd => $self->sietima, - # App::Spec 0.005 really wants a class name - class => ref($self->sietima), }); } 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'), }; |