Commit b0676a22 authored by sikeda's avatar sikeda
Browse files

[-dev] Key 'sender' given to Sympa::Request instance was renamed to 'email'.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12607 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 7cba18fc
......@@ -6047,7 +6047,7 @@ sub do_subscribe {
my $spool_req = Sympa::Spool::Request->new;
my $request = Sympa::Request->new_from_tuples(
context => $list,
sender => $param->{'user'}{'email'},
email => $param->{'user'}{'email'},
custom_attribute => $in{custom_attribute},
action => 'add'
);
......@@ -8141,7 +8141,7 @@ sub do_add {
last unless $handle;
next
unless $request
and grep { $request->{sender} eq $_ } @added_users;
and grep { $request->{email} eq $_ } @added_users;
 
$spool_req->remove($handle);
}
......@@ -8222,10 +8222,10 @@ sub do_add_fromsub {
);
next;
}
next unless defined $request->{sender} and $request->{sender} =~ /\S/;
next unless defined $request->{email} and $request->{email} =~ /\S/;
 
$list->add_list_member(
{ email => $request->{sender},
{ email => $request->{email},
gecos => $request->{gecos},
custom_attribute => $request->{custom_attribute},
}
......@@ -8258,7 +8258,7 @@ sub do_add_fromsub {
} else {
# Delete subscription request.
$spool_req->remove($handle);
web_db_log({target => $request->{sender}, status => 'success'});
web_db_log({target => $request->{email}, status => 'success'});
$total++;
}
}
......@@ -22167,7 +22167,7 @@ sub do_subindex {
date => $language->gettext_strftime(
'%d %b %Y', localtime $request->{date}
),
email => $request->{sender},
email => $request->{email},
epoch => $request->{date},
gecos => $request->{gecos},
},
......
......@@ -1208,7 +1208,7 @@ sub subscribe {
my $spool_req = Sympa::Spool::Request->new;
my $request = Sympa::Request->new_from_tuples(
context => $list,
sender => $sender,
email => $sender,
gecos => $comment,
action => 'add',
date => $message->{date}, # Keep date of message.
......@@ -1895,7 +1895,7 @@ sub add {
my $spool_req = Sympa::Spool::Request->new(
context => $list,
sender => $email,
email => $email,
action => 'add'
);
while (1) {
......
......@@ -40,8 +40,8 @@ sub new {
my $serialized = shift;
my $self = bless {@_} => $class;
$self->{sender} = Sympa::Tools::Text::canonic_email($self->{sender})
if defined $self->{sender};
$self->{email} = Sympa::Tools::Text::canonic_email($self->{email})
if defined $self->{email};
# Get attributes from pseudo-header fields at the top of serialized
# message. Note that field names are case-sensitive.
......@@ -71,9 +71,9 @@ sub new {
Sympa::Tools::Data::decode_custom_attribute($serialized);
}
if ($self->{sender}
if ($self->{email}
and not(defined $self->{gecos} and length $self->{gecos})) {
my $user = Sympa::User->new($self->{sender});
my $user = Sympa::User->new($self->{email});
$self->{gecos} = $user->gecos if $user and $user->gecos;
}
......
......@@ -911,7 +911,7 @@ sub add {
my $spool_req = Sympa::Spool::Request->new(
context => $list,
sender => $email,
email => $email,
action => 'add'
);
while (1) {
......@@ -1480,7 +1480,7 @@ sub subscribe {
my $spool_req = Sympa::Spool::Request->new;
my $request = Sympa::Request->new_from_tuples(
context => $list,
sender => $sender,
email => $sender,
gecos => $gecos,
action => 'add'
);
......
......@@ -40,10 +40,10 @@ sub _filter {
my $self = shift;
my $metadata = shift;
# Decode sender e-mail.
$metadata->{sender} =
Sympa::Tools::Text::decode_filesystem_safe($metadata->{sender})
if $metadata and $metadata->{sender};
# Decode e-mail.
$metadata->{email} =
Sympa::Tools::Text::decode_filesystem_safe($metadata->{email})
if $metadata and $metadata->{email};
1;
}
......@@ -52,10 +52,10 @@ sub _filter_pre {
my $self = shift;
my $metadata = shift;
# Encode sender e-mail.
$metadata->{sender} =
Sympa::Tools::Text::encode_filesystem_safe($metadata->{sender})
if $metadata and $metadata->{sender};
# Encode e-mail.
$metadata->{email} =
Sympa::Tools::Text::encode_filesystem_safe($metadata->{email})
if $metadata and $metadata->{email};
1;
}
......@@ -66,7 +66,7 @@ sub _glob_pattern { shift->{_pattern} }
use constant _marshal_format => '%ld,%s@%s_%s,%s,%s';
use constant _marshal_keys =>
[qw(date localpart domainpart AUTHKEY sender action)];
[qw(date localpart domainpart AUTHKEY email action)];
use constant _marshal_regexp =>
qr{\A(\d+),([^\s\@]+)\@([-.\w]+)_([\da-f]+),([^\s,]*),(\w+)\z};
......@@ -76,7 +76,7 @@ sub new {
my $self = $class->SUPER::new(%options);
# Build glob pattern using encoded sender e-mail.
# Build glob pattern using encoded e-mail.
if ($self) {
my $opts = {%options};
$self->_filter_pre($opts);
......@@ -127,7 +127,7 @@ See also L<Sympa::Spool/"Public methods">.
=over
=item new ( [ context =E<gt> $list ], [ action =E<gt> $action ],
[ authkey =E<gt> $id ], [ sender =E<gt> $email ])
[ authkey =E<gt> $id ], [ email =E<gt> $email ])
=item next ( [ no_lock =E<gt> 1 ] )
......@@ -164,7 +164,7 @@ when the request is stored to spool.
Unix time when the request was submitted.
=item {sender}
=item {email}
E-mail of user who submitted the request, or target e-mail of the request.
......
......@@ -1748,7 +1748,7 @@ sub upgrade {
my $custom_attribute =
Sympa::Tools::Data::decode_custom_attribute($req_string);
my $request = Sympa::Request->new_from_tuples(
sender => $email,
email => $email,
gecos => $gecos,
custom_attribute => $custom_attribute,
action => 'add',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment