[2885] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[PATCH] Only handle CCs in messages sent directly to you.

daemon@ATHENA.MIT.EDU (David Benjamin)
Sat Feb 5 22:52:04 2011

From: David Benjamin <davidben@MIT.EDU>
To: barnowl-dev@mit.edu
Date: Sat,  5 Feb 2011 22:51:27 -0500
In-Reply-To: <1296960641-28959-1-git-send-email-davidben@mit.edu>

[In looking at Adam's patch, it occurred to me that this change may as
well also move the $cc line to the appropriate block while I'm at it.]

A zephyr with a CC line received on @SOME-REALM would still handle the
CC logic in replycmd. This oddity could possibly be retrofited to allow
@SOME-REALM to participate in CC'd messages, but that would require us
to handle CC lines on messages received on *. In the meantime, let's not
leave a half-baked not-feature.

Also refactor the block slightly. 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 |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/perl/lib/BarnOwl/Message/Zephyr.pm b/perl/lib/BarnOwl/Message/Zephyr.pm
index 89a8bb5..13d3cd0 100644
--- a/perl/lib/BarnOwl/Message/Zephyr.pm
+++ b/perl/lib/BarnOwl/Message/Zephyr.pm
@@ -170,12 +170,13 @@ 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;
+            $cc = $self->zephyr_cc();
         }
     }
 
-- 
1.7.3.3.399.g06ddf


home help back first fref pref prev next nref lref last post