X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=videosite.git;a=blobdiff_plain;f=videosite-irssi.pl;h=86e370d147aea1eb92f90c60976129884bb4ed28;hp=390e26c3fd96eeb9ce328680a371bc7e6ecaac46;hb=01fc17a9fd2a11cd5826a2581fe662e96ac5912c;hpb=4d0981a45ce2331721226a9c3fc154a82d7fc7fa diff --git a/videosite-irssi.pl b/videosite-irssi.pl index 390e26c..86e370d 100644 --- a/videosite-irssi.pl +++ b/videosite-irssi.pl @@ -9,6 +9,9 @@ use File::Spec; use Module::Load; use XML::Simple; use JSON -support_by_pp; +use Carp; + +$SIG{ __DIE__ } = sub { Carp::confess( @_ ) }; # # List of foreground colors. This list is not complete, it just @@ -211,7 +214,8 @@ sub videosite_hook { my ($cmdline, $server, $witem) = @_; my %event = ( message => $cmdline, - ewpf => sub { defined($witem)?$witem->print($_[0]):Irssi::print($_[0]) }, + ewpf => sub { defined($witem)?$witem->print($_[0], MSGLEVEL_CLIENTCRAP):Irssi::print($_[0]) }, + window => defined($witem)?$witem->{server}->{real_address} . "/" . $witem->{name}:"", ); libvideosite::handle_command(\%event); @@ -223,10 +227,11 @@ sub videosite_hook { # sub message_hook { my ($server, $msg, $nick, $userhost, $channel) = @_; - my $evitem = $server->window_item_find($channel); + my $witem = $server->window_item_find($channel); my %event = ( message => $msg, - ewpf => sub { defined($evitem)?$evitem->print($_[0]):Irssi::print($_[0]) }, + ewpf => sub { defined($witem)?$witem->print($_[0], MSGLEVEL_CLIENTCRAP):Irssi::print($_[0]) }, + window => defined($witem)?$witem->{server}->{real_address} . "/" . $witem->{name}:"", ); libvideosite::check_for_link(\%event); @@ -261,7 +266,6 @@ sub videosite_reset { module_path => sub { return File::Spec->catfile(Irssi::get_irssi_dir(), 'scripts') }, quote => sub { s/%/%%/g; return $_ }, reload => \&videosite_reset, - _debug => sub { 1 }, })) { Irssi::print(sprintf("videosite API register failed: %s", $libvideosite::error)); return 0;