Changeset 130633c for perl


Ignore:
Timestamp:
Jul 17, 2009, 9:46:45 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
2f2a643, f9c93cd
Parents:
a52d13a (diff), c08a725 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge branch 'automake'

Conflicts:
	Makefile.in
	libfaim/Makefile.in
	owl.h
Location:
perl
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl.pm

    rfd8dfe7 r22b54a7  
    1818use BarnOwl::Style;
    1919use BarnOwl::Timer;
     20use BarnOwl::Editwin;
    2021
    2122=head1 NAME
     
    316317}
    317318
     319=head2 Modify filters by appending text
     320
     321=cut
     322
     323BarnOwl::new_command("filterappend",
     324    sub { filter_append_helper('appending', '', @_); },
     325    {
     326        summary => "append '<text>' to filter",
     327        usage => "filterappend <filter> <text>",
     328    });
     329
     330BarnOwl::new_command("filterand",
     331    sub { filter_append_helper('and-ing', 'and', @_); },
     332    {
     333        summary => "append 'and <text>' to filter",
     334        usage => "filterand <filter> <text>",
     335    });
     336
     337BarnOwl::new_command("filteror",
     338    sub { filter_append_helper('or-ing', 'or', @_); },
     339    {
     340        summary => "append 'or <text>' to filter",
     341        usage => "filteror <filter> <text>",
     342    });
     343
     344=head3 filter_append_helper ACTION SEP FUNC FILTER APPEND_TEXT
     345
     346Helper to append to filters.
     347
     348=cut
     349
     350sub filter_append_helper
     351{
     352    my $action = shift;
     353    my $sep = shift;
     354    my $func = shift;
     355    my $filter = shift;
     356    my @append = @_;
     357    my $oldfilter = BarnOwl::getfilter($filter);
     358    chomp $oldfilter;
     359    my $newfilter = join(' ', $oldfilter, $sep, @_);
     360    my $msgtext = "To filter '$filter' $action\n'".join(' ', @append)."' to get\n'$newfilter'";
     361    if (BarnOwl::getvar('showfilterchange') eq 'on') {
     362        BarnOwl::admin_message("Filter", $msgtext);
     363    }
     364    BarnOwl::filter($filter, $newfilter);
     365    return;
     366}
     367BarnOwl::new_variable_bool("showfilterchange",
     368                           { default => 1,
     369                             summary => 'Show modifications to filters by filterappend and friends.'});
    318370
    3193711;
  • perl/lib/BarnOwl/Message.pm

    rfd8dfe7 rd1ae4a4  
    2222sub direction   { return shift->{"direction"}; }
    2323sub time        { return shift->{"time"}; }
     24sub unix_time   { return shift->{"unix_time"}; }
    2425sub id          { return shift->{"id"}; }
    2526sub body        { return shift->{"body"}; }
  • perl/lib/BarnOwl/Message/Zephyr.pm

    rbc8275e r30e7ffd  
    179179
    180180    my $cmd;
    181     if(lc $self->opcode eq 'crypt') {
     181    if(lc $self->opcode eq 'crypt' and ( not $sender or $self->is_private)) {
     182        # Responses to zcrypted messages should be zcrypted, so long as we
     183        # aren't switching to personals
    182184        $cmd = 'zcrypt';
    183185    } else {
  • perl/lib/BarnOwl/Style/Default.pm

    ree183be r5550eb0  
    33
    44package BarnOwl::Style::Default;
     5use POSIX qw(strftime);
     6
    57################################################################################
    68# Branching point for various formatting functions in this style.
     
    4042    my $self = shift;
    4143    my $m = shift;
    42     my ($time) = $m->time =~ /(\d\d:\d\d)/;
    43     return $time;
     44    return strftime('%H:%M', localtime($m->unix_time));
    4445}
    4546
  • perl/modules/IRC/lib/BarnOwl/Module/IRC.pm

    r1b62a55 r48f7d12  
    6060    register_commands();
    6161    register_handlers();
    62     BarnOwl::filter('irc type ^IRC$');
     62    BarnOwl::filter('irc type ^IRC$ or ( type ^admin$ and adminheader ^IRC$ )');
    6363}
    6464
     
    375375    $conn->conn->disconnect;
    376376    delete $ircnets{$conn->alias};
     377    return;
    377378}
    378379
     
    387388        BarnOwl::start_edit_win("/msg -a " . $conn->alias . " $to", sub {process_msg($conn, $to, @_)});
    388389    }
     390    return;
    389391}
    390392
     
    415417       );
    416418    BarnOwl::queue_message($msg);
     419    return;
    417420}
    418421
     
    423426    $target ||= shift;
    424427    $conn->conn->mode($target, @_);
     428    return;
    425429}
    426430
     
    432436    push @{$channels{$chan}}, $conn;
    433437    $conn->conn->join($chan, @_);
     438    return;
    434439}
    435440
     
    440445    $channels{$chan} = [grep {$_ ne $conn} @{$channels{$chan} || []}];
    441446    $conn->conn->part($chan);
     447    return;
    442448}
    443449
     
    447453    my $nick = shift or die("Usage: $cmd <new nick>\n");
    448454    $conn->conn->nick($nick);
     455    return;
    449456}
    450457
     
    455462    $conn->names_tmp([]);
    456463    $conn->conn->names($chan);
     464    return;
    457465}
    458466
     
    462470    my $who = shift || die("Usage: $cmd <user>\n");
    463471    $conn->conn->whois($who);
     472    return;
    464473}
    465474
     
    468477    my $conn = shift;
    469478    $conn->conn->motd;
     479    return;
    470480}
    471481
     
    477487    }
    478488    BarnOwl::popless_ztext($message);
     489    return;
    479490}
    480491
     
    485496    BarnOwl::error("WHO $cmd $conn $who");
    486497    $conn->conn->who($who);
     498    return;
    487499}
    488500
     
    492504    my $type = shift || die("Usage: $cmd <chiklmouy> [server] \n");
    493505    $conn->conn->stats($type, @_);
     506    return;
    494507}
    495508
     
    499512    my $chan = shift;
    500513    $conn->conn->topic($chan, @_ ? join(" ", @_) : undef);
     514    return;
    501515}
    502516
     
    505519    my $conn = shift;
    506520    $conn->conn->sl(join(" ", @_));
     521    return;
    507522}
    508523
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    r32620ac r7c83a32  
    273273        $self->whois_tmp
    274274    );
    275     $self->whois_tmp([]);
     275    $self->whois_tmp('');
    276276}
    277277
Note: See TracChangeset for help on using the changeset viewer.