Revert "Add notes to Qpsmtpd::Address class"
This reverts commit ea86b9fdb2
.
Jared said...
I originally considered these functionally identical, but they are
not. The new code, called with, say, $txn->notes('discard',undef),
would result in evaluation as if it were a 'get' method rather than
setting the 'discard' note to undef. That seems quite dangerous. I
suggest either reverting the language back to the '@_ and' model, or
else doing something like:
This commit is contained in:
parent
bab7e29009
commit
01e2190a63
@ -317,20 +317,6 @@ sub host {
|
||||
return $self->{_host};
|
||||
}
|
||||
|
||||
=head2 notes($key[,$value])
|
||||
|
||||
Get or set a note on the recipient. This is a piece of data that you wish
|
||||
to attach to the recipient and read somewhere else. For example you can
|
||||
use this to pass data between plugins.
|
||||
|
||||
=cut
|
||||
|
||||
sub notes {
|
||||
my ($self,$key,$value) = @_;
|
||||
$self->{_notes}->{$key} = $value if defined $value;
|
||||
return $self->{_notes}->{$key};
|
||||
}
|
||||
|
||||
sub _addr_cmp {
|
||||
require UNIVERSAL;
|
||||
my ($left, $right, $swap) = @_;
|
||||
|
@ -108,9 +108,10 @@ sub hello_host {
|
||||
}
|
||||
|
||||
sub notes {
|
||||
my ($self,$key,$value) = @_;
|
||||
$self->{_notes}->{$key} = $value if defined $value;
|
||||
return $self->{_notes}->{$key};
|
||||
my $self = shift;
|
||||
my $key = shift;
|
||||
@_ and $self->{_notes}->{$key} = shift;
|
||||
$self->{_notes}->{$key};
|
||||
}
|
||||
|
||||
sub reset {
|
||||
@ -199,9 +200,7 @@ set after a successful return from those hooks.
|
||||
|
||||
=head2 notes($key [, $value])
|
||||
|
||||
Get or set a note on the transaction. This is a piece of data that you wish
|
||||
to attach to the transaction and read somewhere else. For example you can
|
||||
use this to pass data between plugins.
|
||||
Connection-wide notes, used for passing data between plugins.
|
||||
|
||||
=head2 clone([%args])
|
||||
|
||||
|
@ -55,9 +55,11 @@ sub header {
|
||||
#}
|
||||
|
||||
sub notes {
|
||||
my ($self,$key,$value) = @_;
|
||||
$self->{_notes}->{$key} = $value if defined $value;
|
||||
return $self->{_notes}->{$key};
|
||||
my $self = shift;
|
||||
my $key = shift;
|
||||
@_ and $self->{_notes}->{$key} = shift;
|
||||
#warn Data::Dumper->Dump([\$self->{_notes}], [qw(notes)]);
|
||||
$self->{_notes}->{$key};
|
||||
}
|
||||
|
||||
sub set_body_start {
|
||||
|
Loading…
Reference in New Issue
Block a user