Changes in / [db0ac7e:feabce2]


Ignore:
Files:
3 edited

Legend:

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

    r1fd5041b r8df6cbb  
    3939        my $network = $self->network;
    4040        my $channel = $self->channel;
    41         my $filter = "irc-$network-channel-$channel";
    42         my $ftext = qq{type ^irc\$ and network ^$network\$ and channel ^$channel\$};
     41        my $sender = $self->sender;
     42        my ($filter, $ftext);
     43        if ($inst && $self->body =~ /^(\S+):/) {
     44            $filter = "irc-$network-channel-$channel-$sender-$1";
     45            $ftext = qq{type ^irc\$ and network ^$network\$ and channel ^$channel\$ and ( sender ^$sender\$ or sender ^$1\$ )};
     46        } else {
     47            $filter = "irc-$network-channel-$channel";
     48            $ftext = qq{type ^irc\$ and network ^$network\$ and channel ^$channel\$};
     49        }
    4350        BarnOwl::filter("$filter $ftext");
    4451        return $filter;
  • perl/modules/IRC/lib/BarnOwl/Module/IRC.pm

    r919535f rf094fc4  
    114114    BarnOwl::new_command('irc-whois'      => \&cmd_whois);
    115115    BarnOwl::new_command('irc-motd'       => \&cmd_motd);
     116    BarnOwl::new_command('irc-list'       => \&cmd_list);
     117    BarnOwl::new_command('irc-who'        => \&cmd_who);
     118    BarnOwl::new_command('irc-stats'      => \&cmd_stats);
    116119}
    117120
     
    146149        $host = shift @ARGV or die("Usage: $cmd HOST\n");
    147150        if(!$alias) {
    148             if($host =~ /^(?:irc[.])?(\w+)[.]\w+$/) {
     151            if($host =~ /^(?:irc[.])?([\w-]+)[.]\w+$/) {
    149152                $alias = $1;
    150153            } else {
     
    152155            }
    153156        }
    154         $port = shift @ARGV || 6667;
    155157        $ssl ||= 0;
     158        $port = shift @ARGV || ($ssl ? 6697 : 6667);
    156159    }
    157160
     
    275278}
    276279
     280sub cmd_list {
     281    my $cmd = shift;
     282    my $message = BarnOwl::Style::boldify('Current IRC networks:') . "\n";
     283    while (my ($alias, $conn) = each %ircnets) {
     284        $message .= '  ' . $alias . ' => ' . $conn->nick . '@' . $conn->server . "\n";
     285    }
     286    BarnOwl::popless_ztext($message);
     287}
     288
     289sub cmd_who {
     290    my $cmd = shift;
     291    my $conn = get_connection(\@_);
     292    my $who = shift || die("Usage: $cmd <user>\n");
     293    $conn->conn->who($who);
     294}
     295
     296sub cmd_stats {
     297    my $cmd = shift;
     298    my $conn = get_connection(\@_);
     299    my $type = shift || die("Usage: $cmd <chiklmouy> [server] \n");
     300    $conn->conn->stats($type, @_);
     301}
     302
    277303################################################################################
    278304########################### Utilities/Helpers ##################################
  • perlwrap.pm

    r811ad93 r0eaa488  
    132132
    133133Remove a file descriptor previously registered via C<add_dispatch>
     134
     135=head2 create_style NAME OBJECT
     136
     137Creates a new barnowl style with the given NAME defined by the given
     138object. The object must have a C<description> method which returns a
     139string description of the style, and a and C<format_message> method
     140which accepts a C<BarnOwl::Message> object and returns a string that
     141is the result of formatting the message for display.
    134142
    135143=cut
     
    824832    my $self = shift;
    825833    my $m = shift;
    826     return "\@b(PING) from \@b(" . $m->pretty_sender . ")\n";
     834    return "\@b(PING) from \@b(" . $m->pretty_sender . ")";
    827835}
    828836
     
    923931
    924932sub format_ping($) {
     933  my $self = shift;
    925934  my $m = shift;
    926935  return sprintf(
Note: See TracChangeset for help on using the changeset viewer.