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:
Robert 2009-02-12 20:36:58 -08:00
parent bab7e29009
commit 01e2190a63
3 changed files with 10 additions and 23 deletions

View File

@ -317,20 +317,6 @@ sub host {
return $self->{_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 { sub _addr_cmp {
require UNIVERSAL; require UNIVERSAL;
my ($left, $right, $swap) = @_; my ($left, $right, $swap) = @_;

View File

@ -108,9 +108,10 @@ sub hello_host {
} }
sub notes { sub notes {
my ($self,$key,$value) = @_; my $self = shift;
$self->{_notes}->{$key} = $value if defined $value; my $key = shift;
return $self->{_notes}->{$key}; @_ and $self->{_notes}->{$key} = shift;
$self->{_notes}->{$key};
} }
sub reset { sub reset {
@ -199,9 +200,7 @@ set after a successful return from those hooks.
=head2 notes($key [, $value]) =head2 notes($key [, $value])
Get or set a note on the transaction. This is a piece of data that you wish Connection-wide notes, used for passing data between plugins.
to attach to the transaction and read somewhere else. For example you can
use this to pass data between plugins.
=head2 clone([%args]) =head2 clone([%args])

View File

@ -55,9 +55,11 @@ sub header {
#} #}
sub notes { sub notes {
my ($self,$key,$value) = @_; my $self = shift;
$self->{_notes}->{$key} = $value if defined $value; my $key = shift;
return $self->{_notes}->{$key}; @_ and $self->{_notes}->{$key} = shift;
#warn Data::Dumper->Dump([\$self->{_notes}], [qw(notes)]);
$self->{_notes}->{$key};
} }
sub set_body_start { sub set_body_start {