Skip to content

Commit

Permalink
Only link to issue numbers greater than zero
Browse files Browse the repository at this point in the history
This will fix some of the "< ZNC-Linker> https://github.com/znc/znc/issues/0 – 404 Not Found" messages in channel.
  • Loading branch information
amyreese committed May 18, 2014
1 parent 5969421 commit adc22d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion znclinker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ sub OnChanMsg {
$self->put_chan($chan=>"Pointless question detected! $nick, we are not telepaths, please ask a concrete question and wait for an answer. Be sure that you have checked http://wiki.znc.in/FAQ first. You may want to read http://catb.org/~esr/faqs/smart-questions.html Sorry if this is a false alarm.");
}
if (my ($issue) = $what=~m@(?:#|https://github.com/znc/znc/(?:issues|pull)/)(\d+)@) {
$self->CreateSocket('znclinker::github', $issue, $self->GetNetwork, $chan);
if ($issue > 0) {
$self->CreateSocket('znclinker::github', $issue, $self->GetNetwork, $chan);
}
}

return $ZNC::CONTINUE;
Expand Down

0 comments on commit adc22d5

Please sign in to comment.