summaryrefslogtreecommitdiffstats
path: root/scripts/doc.pl
diff options
context:
space:
mode:
authorAilin Nemui2016-02-05 11:06:11 +0100
committerAilin Nemui2016-02-05 11:06:11 +0100
commit85ed11e8aa971dfaedb5610cc82ef0de9b9c5522 (patch)
treecf7c353eb51bb7e412151d89641842008091f2ea /scripts/doc.pl
parentd2aa63d1729486013820d66ee8491009998bd5aa (diff)
downloadscripts.irssi.org-85ed11e8aa971dfaedb5610cc82ef0de9b9c5522.tar.bz2
fix doc.pl to make it pass travis
Diffstat (limited to 'scripts/doc.pl')
-rw-r--r--scripts/doc.pl12
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/doc.pl b/scripts/doc.pl
index de0e3d6..4ed56d2 100644
--- a/scripts/doc.pl
+++ b/scripts/doc.pl
@@ -63,7 +63,7 @@ use Irssi;
use strict;
use vars qw($VERSION %IRSSI);
-$VERSION = "0.0.3";
+$VERSION = "0.0.4";
%IRSSI = (
authors => 'FoxMaSk',
contact => 'foxmask@phpfr.org ',
@@ -137,10 +137,12 @@ sub doc_find {
}
else {
+ my $code = Irssi::Script::friends::->can('get_idx') || Irssi::Script::friends_shasta::->can('get_idx');
+ if ($code && $code->($nick,$address) != -1) {
#call of friends.pl script to determine if the current
#$nick can manage the doc file
#to add
- if ($cmd eq $cmd_add and Irssi::Script::friends::get_idx($channel,$nick,$address) != -1) {
+ if ($cmd eq $cmd_add) {
($keyword,$new_definition) = split /=/,$line,2;
($find,$definition) = exist_doc($keyword);
@@ -158,7 +160,7 @@ sub doc_find {
}
}
#to modify
- elsif ($cmd eq $cmd_mod and Irssi::Script::friends::get_idx($channel,$nick,$address) != -1) {
+ elsif ($cmd eq $cmd_mod) {
($keyword,$new_definition) = split /=/,$line,2;
($find,$definition) = exist_doc($keyword);
@@ -175,7 +177,7 @@ sub doc_find {
}
}
#to delete
- elsif ($cmd eq $cmd_del and Irssi::Script::friends::get_idx($channel,$nick,$address) != -1) {
+ elsif ($cmd eq $cmd_del) {
$keyword = $line;
($find,$definition) = exist_doc($keyword);
if ($find ne '') {
@@ -189,7 +191,7 @@ sub doc_find {
info_doc($server,$info);
}
}
-
+ }
}
}
}