Changeset df7018f for perlwrap.pm


Ignore:
Timestamp:
May 30, 2009, 7:29:16 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:
e04b7a1
Parents:
6223638
git-author:
Alex Dehnert <adehnert@mit.edu> (05/28/09 00:15:48)
git-committer:
Alex Dehnert <adehnert@mit.edu> (05/30/09 19:29:16)
Message:
Display personals better in OneLine mode.

Adds short_personal_context, which enables
protocol modules to specify how to fill the
subcontext column for personal messages

For personal zephyrs, now displays the class
(for non-message) or instance (for -c message).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlwrap.pm

    r6223638 rdf7018f  
    393393# Override if you want a context (instance, network, etc.) on personals
    394394sub personal_context { return ""; }
     395# extra short version, for use where space is especially tight
     396# (eg, the oneline style)
     397sub short_personal_context { return ""; }
    395398
    396399sub delete {
     
    626629    my ($m) = @_;
    627630    return $m->context_reply_cmd();
     631}
     632
     633sub short_personal_context {
     634    my ($m) = @_;
     635    if(lc($m->class) eq 'message')
     636    {
     637        if(lc($m->instance) eq 'personal')
     638        {
     639            return '';
     640        } else {
     641            return $m->instance;
     642        }
     643    } else {
     644        return $m->class;
     645    }
    628646}
    629647
     
    11681186  my $line;
    11691187  if ($m->is_personal) {
     1188
     1189    # Figure out what to show in the subcontext column
    11701190    $line= sprintf(BASE_FORMAT,
    11711191                   $dirsym,
    11721192                   $m->type,
    1173                    '',
     1193                   maybe($m->short_personal_context),
    11741194                   ($dir eq 'out'
    11751195                    ? $m->pretty_recipient
Note: See TracChangeset for help on using the changeset viewer.