Changeset 6223638


Ignore:
Timestamp:
May 30, 2009, 7:29:06 PM (12 years ago)
Author:
Alex Dehnert <adehnert@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
df7018f
Parents:
33539f7
git-author:
Alex Dehnert <adehnert@mit.edu> (05/28/09 05:19:05)
git-committer:
Alex Dehnert <adehnert@mit.edu> (05/30/09 19:29:06)
Message:
Include non-default class in personal_context

I think this turns out to be a no-op, because
only the default class is ever set. Regardless,
this feels like the right thing to do.

Also, slightly refactors to make getting a
-c class -i instance string without default class
or instance easier.

Further, quotes instance in personal context,
which seems reasonable since the syntax seems
intended to be that of zwrite.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlwrap.pm

    r33539f7 r6223638  
    605605}
    606606
     607# Portion of the reply command that preserves the context
     608sub context_reply_cmd {
     609    my $m = shift;
     610    my $class = "";
     611    if (lc($m->class) ne "message") {
     612        $class = "-c " . BarnOwl::quote($m->class);
     613    }
     614    my $instance = "";
     615    if (lc($m->instance) ne "personal") {
     616        $instance = "-i " . BarnOwl::quote($m->instance);
     617    }
     618    if (($class eq "") or  ($instance eq "")) {
     619        return $class . $instance;
     620    } else {
     621        return $class . " " . $instance;
     622    }
     623}
     624
    607625sub personal_context {
    608626    my ($m) = @_;
    609     if (lc($m->instance) eq "personal") {
    610         return "";
    611     } else {
    612         return "-i " . $m->instance;
    613     }
     627    return $m->context_reply_cmd();
    614628}
    615629
     
    681695    }
    682696
    683     if (lc $class ne 'message') {
    684         $cmd .= " -c " . BarnOwl::quote($class);
    685     }
    686     if (lc $instance ne 'personal') {
    687         $cmd .= " -i " . BarnOwl::quote($instance);
    688     }
     697    my $context_part = $self->context_reply_cmd();
     698    $cmd .= " " . $context_part unless ($context_part eq '');
    689699    if ($to ne '') {
    690700        $to = strip_realm($to);
Note: See TracChangeset for help on using the changeset viewer.