Changeset 69c3878 for perl


Ignore:
Timestamp:
Oct 10, 2009, 9:24:27 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:
dcc3f80
Parents:
e1e59a7 (diff), 7cfb1df (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 'irc'
Location:
perl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/IRC/lib/BarnOwl/Module/IRC.pm

    r0c4a190 r69c3878  
    545545            $conn = get_connection_by_alias($alias);
    546546        }
    547         if(!$conn && $use_channel) {
     547        if($use_channel) {
    548548            $channel = $ARGV[0];
    549549            if(defined($channel) && $channel =~ /^#/) {
    550550                if($channels{$channel} && @{$channels{$channel}} == 1) {
    551551                    shift @ARGV;
    552                     $conn = $channels{$channel}[0];
    553                 } 
     552                    $conn = $channels{$channel}[0] unless $conn;
     553                }
     554            } elsif ($m && $m->type eq 'IRC' && !$m->is_private) {
     555                $channel = $m->channel;
    554556            } else {
    555                 if($m && $m->type eq 'IRC' && !$m->is_private) {
    556                     $channel = $m->channel;
    557                 } else {
    558                     undef $channel;
    559                 }
     557                undef $channel;
    560558            }
    561559        }
     560
    562561        if(!$channel && $use_channel == REQUIRE_CHANNEL) {
    563562            die("Usage: $cmd <channel>\n");
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    r744769e r7cfb1df  
    7474    $self->conn->add_handler(endofwhois=> sub { shift; $self->on_endofwhois(@_) });
    7575    $self->conn->add_handler(mode      => sub { shift; $self->on_mode(@_) });
    76 
    77     # * nosuchchannel
    78     # *
     76    $self->conn->add_handler(nosuchchannel => sub { shift; $self->on_nosuchchannel(@_) });
    7977
    8078    return $self;
     
    204202    my $self = shift;
    205203    delete $BarnOwl::Module::IRC::ircnets{$self->alias};
     204    for my $k (keys %BarnOwl::Module::IRC::channels) {
     205        my @conns = grep {$_ ne $self} @{$BarnOwl::Module::IRC::channels{$k}};
     206        if(@conns) {
     207            $BarnOwl::Module::IRC::channels{$k} = \@conns;
     208        } else {
     209            delete $BarnOwl::Module::IRC::channels{$k};
     210        }
     211    }
    206212    BarnOwl::remove_dispatch($self->{FD});
    207213    BarnOwl::admin_message('IRC',
     
    282288                           join(" ", $evt->args) . "on " . $evt->to->[0]
    283289                          );
     290}
     291
     292sub on_nosuchchannel {
     293    my ($self, $evt) = @_;
     294    BarnOwl::admin_message("IRC",
     295                           "[" . $self->alias . "] " .
     296                           "No such channel: " . [$evt->args]->[1])
    284297}
    285298
  • perl/lib/BarnOwl.pm

    rde3f641 r77c87b2  
    435435sub default_zephyr_signature
    436436{
    437   if (my $zsig = getvar('zsig')) {
    438     return $zsig;
     437  my $zsig = getvar('zsig');
     438  if (!$zsig && (my $zsigproc = getvar('zsigproc'))) {
     439    $zsig = `$zsigproc`;
     440  } elsif (!defined($zsig = get_zephyr_variable('zwrite-signature'))) {
     441    $zsig = ((getpwuid($<))[6]);
     442    $zsig =~ s/,.*//;
    439443  }
    440   if (my $zsigproc = getvar('zsigproc')) {
    441     return `$zsigproc`;
    442   }
    443   my $zwrite_signature = get_zephyr_variable('zwrite-signature');
    444   if (defined($zwrite_signature)) {
    445     return $zwrite_signature;
    446   }
    447   my $name = ((getpwuid($<))[6]);
    448   $name =~ s/,.*//;
    449   return $name;
     444  chomp($zsig);
     445  return $zsig;
    450446}
    451447
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm

    r5118b32 r26cde20  
    321321              . "add <jid>     Adds <jid> to your roster.\n\n"
    322322              . "unsub <jid>   Unsubscribe from <jid>'s presence.\n\n"
    323               . "remove <jid>  Removes <jid> to your roster. (implicit unsub)\n\n"
     323              . "remove <jid>  Removes <jid> from your roster. (implicit unsub)\n\n"
    324324              . "auth <jid>    Authorizes <jid> to subscribe to your presence.\n\n"
    325325              . "deauth <jid>  De-authorizes <jid>'s subscription to your presence.\n\n"
Note: See TracChangeset for help on using the changeset viewer.