[2896] in BarnOwl Developers

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

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

daemon@ATHENA.MIT.EDU (Nelson Elhage)
Thu Feb 10 21:03:25 2011

Date: Thu, 10 Feb 2011 21:03:19 -0500
From: Nelson Elhage <nelhage@nelhage.com>
To: David Benjamin <davidben@mit.edu>
Cc: barnowl-dev@mit.edu
In-Reply-To: <1296964287-30263-1-git-send-email-davidben@mit.edu>

lgtm

On Sat, Feb 05, 2011 at 10:51:27PM -0500, David Benjamin wrote:
> [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