aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2017-02-07 18:32:55 +0000
committerdakkar <dakkar@thenautilus.net>2017-02-07 18:32:55 +0000
commited980d6059ac994499f1a75b4a56796e00184ff7 (patch)
tree578e494c6f8768760eea4861a99494d8402f7858 /lib
parentFix typo in POD heading (diff)
downloadSietima-ed980d6059ac994499f1a75b4a56796e00184ff7.tar.gz
Sietima-ed980d6059ac994499f1a75b4a56796e00184ff7.tar.bz2
Sietima-ed980d6059ac994499f1a75b4a56796e00184ff7.zip
rename 'admin' to 'owner'
Diffstat (limited to 'lib')
-rw-r--r--lib/Sietima/Role/Headers.pm3
-rw-r--r--lib/Sietima/Role/SubscriberOnly/Moderate.pm14
-rw-r--r--lib/Sietima/Role/WithOwner.pm (renamed from lib/Sietima/Role/WithAdmin.pm)20
3 files changed, 17 insertions, 20 deletions
diff --git a/lib/Sietima/Role/Headers.pm b/lib/Sietima/Role/Headers.pm
index 27f79fb..166b355 100644
--- a/lib/Sietima/Role/Headers.pm
+++ b/lib/Sietima/Role/Headers.pm
@@ -67,9 +67,6 @@ sub _add_headers_to($self,$message) {
);
}
- # little renaming
- $addresses->{owner} = delete $addresses->{admin};
-
# if nobody declared a "post" address, let's guess it's the same
# as the address we send from
$addresses->{post} //= $return_path;
diff --git a/lib/Sietima/Role/SubscriberOnly/Moderate.pm b/lib/Sietima/Role/SubscriberOnly/Moderate.pm
index 0c56040..c0e4a01 100644
--- a/lib/Sietima/Role/SubscriberOnly/Moderate.pm
+++ b/lib/Sietima/Role/SubscriberOnly/Moderate.pm
@@ -13,7 +13,7 @@ Sietima::Role::SubscriberOnly::Moderate - moderate messages from non-subscribers
my $sietima = Sietima->with_traits('SubscribersOnly::Moderate')->new({
%args,
- admin => 'listmaster@example.com',
+ owner => 'listmaster@example.com',
mail_store => {
class => 'Sietima::MailStore::FS',
root => '/tmp',
@@ -24,26 +24,26 @@ Sietima::Role::SubscriberOnly::Moderate - moderate messages from non-subscribers
A L<< C<Sietima> >> list with this role applied will accept incoming
emails coming from non-subscribers, and store it for moderation. Each
-such email will be forwarded (as an attachment) to the list's admin.
+such email will be forwarded (as an attachment) to the list's owner.
-The admin will the be able to delete the message, or allow it.
+The owner will the be able to delete the message, or allow it.
This is a "sub-role" of L<<
C<SubscribersOnly>|Sietima::Role::SubscriberOnly >>, L<<
C<WithMailStore>|Sietima::Role::WithMailStore >>, and L<<
-C<WithAdmin>|Sietima::Role::WithAdmin >>.
+C<WithOwner>|Sietima::Role::WithOwner >>.
=cut
with 'Sietima::Role::SubscriberOnly',
'Sietima::Role::WithMailStore',
- 'Sietima::Role::WithAdmin';
+ 'Sietima::Role::WithOwner';
sub munge_mail_from_non_subscriber ($self,$mail) {
my $id = $self->mail_store->store($mail,'moderation');
my $notice = Email::Stuffer
->from($self->return_path->address)
- ->to($self->admin->address)
+ ->to($self->owner->address)
->subject("Message held for moderation - ".$mail->header_str('subject'))
->text_body("Use id $id to refer to it")
->attach(
@@ -53,7 +53,7 @@ sub munge_mail_from_non_subscriber ($self,$mail) {
);
$self->transport->send($notice->email,{
from => $self->return_path,
- to => [ $self->admin ],
+ to => [ $self->owner ],
});
return;
}
diff --git a/lib/Sietima/Role/WithAdmin.pm b/lib/Sietima/Role/WithOwner.pm
index 2781bf8..dccb904 100644
--- a/lib/Sietima/Role/WithAdmin.pm
+++ b/lib/Sietima/Role/WithOwner.pm
@@ -1,4 +1,4 @@
-package Sietima::Role::WithAdmin;
+package Sietima::Role::WithOwner;
use Moo::Role;
use Sietima::Policy;
use Sietima::Types qw(Address AddressFromStr);
@@ -6,34 +6,34 @@ use namespace::clean;
=head1 NAME
-Sietima::Role::WithAdmin - role for lists with an owner / admin
+Sietima::Role::WithOwner - role for lists with an owner
=head1 SYNOPSIS
- my $sietima = Sietima->with_traits('WithAdmin')->new({
+ my $sietima = Sietima->with_traits('WithOwner')->new({
%args,
- admin => 'listmaster@example.com',
+ owner => 'listmaster@example.com',
});
=head1 DESCRIPTION
-This role adds an L<< /C<admin> >> attribute, and exposes it via the
+This role adds an L<< /C<owner> >> attribute, and exposes it via the
L<< C<list_addresses>|Sietima/list_addresses >> method.
On its own, this role is not very useful, but other roles (like L<<
C<SubscriberOnly::Moderate>|Sietima::Role::SubscriberOnly::Moderate
->>) can have uses for an admin / owner address.
+>>) can have uses for an owner address.
=head1 ATTRIBUTES
-=head2 C<admin>
+=head2 C<owner>
Required instance of L<< C<Email::Address> >>, coercible from a
-string. This is the address of the owner / admin of the list.
+string. This is the address of the owner of the list.
=cut
-has admin => (
+has owner => (
is => 'ro',
isa => Address,
required => 1,
@@ -43,7 +43,7 @@ has admin => (
around list_addresses => sub($orig,$self) {
return +{
$self->$orig->%*,
- admin => $self->admin,
+ owner => $self->owner,
};
};