use Irssi; use vars qw($VERSION %IRSSI); $VERSION = "1.0.3"; %IRSSI = ( authors => "Pasi Lallinaho ", name => "BitlBee fixes", description => "Several fixes for BitlBee+irssi combination.", ); # What does this script do? # - Stops &bitlbee-messages going into awaylog. # - Shortens awaymessages in lists (fits into 80x24 terminal window). # - Makes (MSN) switchboard messages "CRAP" and "NO_ACT". sub incoming_message { my( $server, $message, $nick, $address, $target ) = @_; if( $target eq "&bitlbee" ) { if( $nick eq "root" ) { if( ( index( $message, "switchboard" ) >= 0 ) || ( index( $message, "Switchboard" ) >= 0 ) || ( index( $message, "Got a call" ) >= 0 ) ) { $message = "%R>%N " . $message; $server->print( $target, $message, MSGLEVEL_MSGS+MSGLEVEL_NO_ACT ); Irssi::signal_stop( ); return; } $message =~ s/Be Right Back/BRB/g; $message =~ s/Do Not Disturb/DND/g; $message =~ s/On the Phone/Phone/g; $message =~ s/Out to Lunch/Lunch/g; } $message = "!%R" . $nick . "%N%c:%N " . $message; $server->print( $target, $message, MSGLEVEL_MSGS ); Irssi::signal_stop( ); } } Irssi::signal_add_first( "message public", "incoming_message" );