- ewpf => sub { defined($witem)?$witem->print($_[0]):Irssi::print($_[0]) },
+ io => sub { defined($witem)?$witem->print($_[0], MSGLEVEL_CLIENTCRAP):Irssi::print($_[0]) },
+ window => defined($witem)?$witem->{server}->{real_address} . "/" . $witem->{name}:"",
#
sub message_hook {
my ($server, $msg, $nick, $userhost, $channel) = @_;
#
sub message_hook {
my ($server, $msg, $nick, $userhost, $channel) = @_;
- ewpf => sub { defined($evitem)?$evitem->print($_[0]):Irssi::print($_[0]) },
+ io => sub { defined($witem)?$witem->print($_[0], MSGLEVEL_CLIENTCRAP):Irssi::print($_[0]) },
+ window => defined($witem)?$witem->{server}->{real_address} . "/" . $witem->{name}:"",
+ my $libpath;
+
+ # Find out the script directory, and add it to @INC.
+ # This is necessary to find libvideosite.pm
+ $libpath = File::Spec->catfile(Irssi::get_irssi_dir(), 'scripts');
+
+ # If the library is already loaded unload it
+ foreach (keys(%INC)) {
+ if ($INC{$_} eq File::Spec->catfile($libpath, 'libvideosite.pm')) {
+ delete($INC{$_});
+ }
+ }
+
+ push(@INC, $libpath);
+ load 'libvideosite';
+
unless(libvideosite::register_api({
io => sub { Irssi::print($_[0]) },
config_init => \&config_init,
config_get => \&config_get,
config_set => \&config_set,
config_has => \&config_has,
unless(libvideosite::register_api({
io => sub { Irssi::print($_[0]) },
config_init => \&config_init,
config_get => \&config_get,
config_set => \&config_set,
config_has => \&config_has,
config_del => \&config_del,
color => \&colorpair,
module_path => sub { return File::Spec->catfile(Irssi::get_irssi_dir(), 'scripts') },
quote => sub { s/%/%%/g; return $_ },
config_del => \&config_del,
color => \&colorpair,
module_path => sub { return File::Spec->catfile(Irssi::get_irssi_dir(), 'scripts') },
quote => sub { s/%/%%/g; return $_ },
- # Find out the script directory, and add it to @INC.
- # This is necessary to find libvideosite.pm
-
- push(@INC, File::Spec->catfile(Irssi::get_irssi_dir(), 'scripts'));
- load 'libvideosite';