[2883] in BarnOwl Developers
[PATCH] Re-order recipient code in Zephyr replycmd
daemon@ATHENA.MIT.EDU (David Benjamin)
Sat Feb 5 21:51:01 2011
From: David Benjamin <davidben@MIT.EDU>
To: barnowl-dev@mit.edu
Date: Sat, 5 Feb 2011 21:50:41 -0500
The original formulation is confusing; it means to condition on the
recipient of the message we reply to, but actually checks $to, the
recipient we use in the reply. It just happens that in one case, the two
are equal. The original code would assume that case and then change its
mind if it was wrong.
---
perl/lib/BarnOwl/Message/Zephyr.pm | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/perl/lib/BarnOwl/Message/Zephyr.pm b/perl/lib/BarnOwl/Message/Zephyr.pm
index 89a8bb5..bcb870a 100644
--- a/perl/lib/BarnOwl/Message/Zephyr.pm
+++ b/perl/lib/BarnOwl/Message/Zephyr.pm
@@ -170,11 +170,12 @@ sub replycmd {
} else {
$class = $self->class;
$instance = $self->instance;
- $to = $self->recipient;
$cc = $self->zephyr_cc();
- if($to eq '*' || $to eq '') {
+ if ($self->recipient eq '*' || $self->recipient eq '') {
$to = '';
- } elsif($to !~ /^@/) {
+ } elsif ($self->recipient =~ /^@/) {
+ $to = $self->recipient;
+ } else {
$to = $self->sender;
}
}
--
1.7.3.3.399.g06ddf