]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
(bitlbee_blist) merged Olof Johansson's changes
authorTijmen Ruizendaal <redacted>
Mon, 14 Feb 2011 09:40:30 +0000 (10:40 +0100)
committerbw1 <redacted>
Sun, 14 Apr 2019 14:00:01 +0000 (16:00 +0200)
scripts/bitlbee_blist.pl

index 1ed0971055ddbe280b0bd38527d9489c0ef47be9..f9d3ba4a29a0876202cd2d68c19254aed4ffd6a6 100644 (file)
@@ -1,15 +1,21 @@
+# Changelog
+#
+# 2008-09-13 (v 0.5)
+# Thanks to Olof Johansson the first parm can just be a regexp.
+#
+
 use strict;
 use vars qw($VERSION %IRSSI);
 
-$VERSION = '0.41';
+$VERSION = '0.5';
 %IRSSI = (
-    authors    => 'Tijmen "timing" Ruizendaal',
-    contact    => 'tijmen.ruizendaal@gmail.com',
-    name       => 'bitlbee_blist',
-    description        => '/blist <all|online|offline|away> <word>,  greps <word> from blist for bitlbee',
-    license    => 'GPLv2',
-    url                => 'http://the-timing.nl/stuff/irssi-bitlbee',
-    changed    => '2008-09-13', 
+               authors => 'Tijmen "timing" Ruizendaal',
+               contact => 'tijmen.ruizendaal@gmail.com',
+               name    => 'bitlbee_blist',
+               description     => '/blist <all|online|offline|away|word> <word>,       greps <word> from blist for bitlbee',
+               license => 'GPLv2',
+               url             => 'http://the-timing.nl/stuff/irssi-bitlbee',
+               changed => '2008-09-13', 
 );
 
 my $bitlbee_server_tag = "localhost";
@@ -19,11 +25,11 @@ my ($list, $word);
 get_channel();
 
 Irssi::signal_add_last 'channel sync' => sub {
-        my( $channel ) = @_;
-        if( $channel->{topic} eq "Welcome to the control channel. Type \x02help\x02 for help information." ){
-                $bitlbee_server_tag = $channel->{server}->{tag};
-                $bitlbee_channel = $channel->{name};
-        }
+       my( $channel ) = @_;
+       if( $channel->{topic} eq "Welcome to the control channel. Type \x02help\x02 for help information." ){
+               $bitlbee_server_tag = $channel->{server}->{tag};
+               $bitlbee_channel = $channel->{name};
+       }
 };
 
 sub get_channel {
@@ -39,31 +45,32 @@ sub get_channel {
 }
 
 sub blist {
-  my ($args, $server, $winit) = @_;
-  ($list, $word) = split(/ /, $args, 2);
-  $list=lc $list;
-  $word=lc $word;
-  if($list ne "all" && $list ne "online" && $list ne "offline" &&
-     $list ne "away" && $list ne "") {
-    $word=$list;
-    $list="";
-  }
-  if (Irssi::active_win->{'active'}->{'name'} eq $bitlbee_channel) {
-    Irssi::active_win()->command("msg $bitlbee_channel blist $list");
-    Irssi::signal_add('event privmsg', 'grep');  
-  } else {
-    print "Only use in $bitlbee_channel.";
-  }
+       my ($args, $server, $winit) = @_;
+       ($list, $word) = split(/ /, $args, 2);
+       $list=lc $list;
+       $word=lc $word;
+       if($list ne "all" && $list ne "online" && $list ne "offline" &&
+               $list ne "away" && $list ne "") {
+               $word=$list;
+               $list="";
+       }
+       if (Irssi::active_win->{'active'}->{'name'} eq $bitlbee_channel) {
+               print "blist $list";
+               Irssi::active_win()->command("msg $bitlbee_channel blist $list");
+               Irssi::signal_add('event privmsg', 'grep');     
+       } else {
+               print "Only use in $bitlbee_channel.";
+       }
 }
 
 sub grep {
-  my ($server, $data, $nick, $address) = @_;
-  my ($target, $text) = split(/ :/, $data, 2);
-  $text=lc $text;
-  if ($text =~ /$word/ && $target =~ /$bitlbee_channel/){
-    ##do nothing
-  } else {Irssi::signal_stop();}
-  if ($text =~ /buddies/ && $target =~/$bitlbee_channel/){Irssi::signal_remove('event privmsg', 'grep');} 
+       my ($server, $data, $nick, $address) = @_;
+       my ($target, $text) = split(/ :/, $data, 2);
+       $text=lc $text;
+       if ($text =~ /$word/ && $target =~ /$bitlbee_channel/){
+               ##do nothing
+       } else {Irssi::signal_stop();}
+       if ($text =~ /buddies/ && $target =~/$bitlbee_channel/){Irssi::signal_remove('event privmsg', 'grep');} 
 }
 
 Irssi::command_bind('blist','blist');
git clone https://git.99rst.org/PROJECT