Commit 8990bc27 authored by Kiyoshi Aman's avatar Kiyoshi Aman
Browse files

bug.pl: add $src for namespacing

parent deb1c5a8
......@@ -43,7 +43,7 @@ my $handler = Chessa::Bug->new(
);
sub url_process {
my ($on_info, $nick, $text, $errors) = @_;
my ($src, $on_info, $nick, $text, $errors) = @_;
my @nickblock = split ' ', Irssi::settings_get_str('bug_nick_blacklist');
if ((grep {uc($nick) eq uc($_) } @nickblock) || ($text =~ /nobug/) || ($text =~ /^[!.\$][a-z]+/i)) {
return;
......@@ -59,18 +59,22 @@ Irssi::signal_add 'ctcp action' => sub {
unless (grep { uc($target) eq uc($_)} @channels) {
return;
}
my $src = $target;
$src =~ s/^#//;
my $on_info = sub {
my ($msg) = @_;
$server->command("msg $target $msg");
};
url_process($on_info, $nick, $text);
url_process($src, $on_info, $nick, $text);
};
Irssi::signal_add 'event privmsg' => sub {
my ($server, $data, $nick, $address) = @_;
my ($target, $text) = split / :/, $data, 2;
$target = $nick if (uc($target) eq uc($server->{nick}));
return if (uc($target) eq uc($server->{nick}));
my $src = $target;
$src =~ s/^#//;
my $on_info = sub {
my ($msg) = @_;
......@@ -82,5 +86,5 @@ Irssi::signal_add 'event privmsg' => sub {
return;
}
url_process($on_info, $nick, $text);
url_process($src, $on_info, $nick, $text);
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment