Changeset dfaa47d for perlwrap.pm


Ignore:
Timestamp:
May 14, 2009, 11:41:34 PM (15 years ago)
Author:
Geoffrey Thomas <geofft@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
cdaf294
Parents:
e1b136bf
git-author:
Geoffrey Thomas <geofft@mit.edu> (05/14/09 23:39:12)
git-committer:
Geoffrey Thomas <geofft@mit.edu> (05/14/09 23:41:34)
Message:
Display context for personals, so as to make <message,*,%me> usable.

Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlwrap.pm

    r2b6de9d rdfaa47d  
    390390sub pretty_sender    { return shift->sender; }
    391391sub pretty_recipient { return shift->recipient; }
     392
     393# Override if you want a context (instance, network, etc.) on personals
     394sub personal_context { return ""; }
    392395
    393396sub delete {
     
    584587    my ($m) = @_;
    585588    return ((lc($m->class) eq "message")
    586             && (lc($m->instance) eq "personal")
    587589            && $m->is_private);
    588590}
     
    601603    my ($m) = @_;
    602604    return strip_realm($m->recipient);
     605}
     606
     607sub personal_context {
     608    my ($m) = @_;
     609    if (lc($m->instance) eq "personal") {
     610        return "";
     611    } else {
     612        return "-i " . $m->instance;
     613    }
    603614}
    604615
     
    10231034    my $header;
    10241035    if ( $m->is_personal ) {
     1036        my $personal_context = $m->personal_context;
     1037        $personal_context = ' [' . $personal_context . ']' if $personal_context;
     1038
    10251039        if ( $m->direction eq "out" ) {
    1026             $header = ucfirst $m->type . " sent to " . $m->pretty_recipient;
     1040            $header = ucfirst $m->type . $personal_context . " sent to " . $m->pretty_recipient;
    10271041        } else {
    1028             $header = ucfirst $m->type . " from " . $m->pretty_sender;
     1042            $header = ucfirst $m->type . $personal_context . " from " . $m->pretty_sender;
    10291043        }
    10301044    } else {
Note: See TracChangeset for help on using the changeset viewer.