summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorailin-nemui2017-04-05 09:19:26 +0200
committerGitHub2017-04-05 09:19:26 +0200
commit4918fe97cabf4d1f03ca7e4ef9c1e1b7b8f2f1e7 (patch)
tree4901d76d8a0ccd0b9d951e3f60c5f5beae134665
parentfb18e157c763e483cf41dc07c46e51f75a5c83ed (diff)
parentfd440b052f5041128a8a0ac9404479046e5560cd (diff)
downloadscripts.irssi.org-4918fe97cabf4d1f03ca7e4ef9c1e1b7b8f2f1e7.tar.bz2
Merge pull request #388 from bw1/newsline
[newsline][crit] rewrite open; defined openurl
-rw-r--r--_testing/config.yml1
-rw-r--r--scripts/newsline.pl12
2 files changed, 6 insertions, 7 deletions
diff --git a/_testing/config.yml b/_testing/config.yml
index 012305b..2f81859 100644
--- a/_testing/config.yml
+++ b/_testing/config.yml
@@ -47,7 +47,6 @@ whitelist:
- l33tmusic
- log2ansi
- mkshorterlink
- - newsline
- oidenty
- 'on'
- osd
diff --git a/scripts/newsline.pl b/scripts/newsline.pl
index 0f54eee..b37cfcc 100644
--- a/scripts/newsline.pl
+++ b/scripts/newsline.pl
@@ -3,7 +3,7 @@
use strict;
use vars qw($VERSION %IRSSI);
-$VERSION = '2003021101';
+$VERSION = '2017040101';
%IRSSI = (
authors => 'Stefan \'tommie\' Tomanek',
contact => 'stefan@pico.ruhr.de',
@@ -287,10 +287,10 @@ sub call_openurl ($) {
my ($url) = @_;
no strict "refs";
# check for a loaded openurl
- if (defined %{ "Irssi::Script::openurl::" }) {
- &{ "Irssi::Script::openurl::launch_url" }($url);
+ if (my $code = Irssi::Script::openurl::->can('launch_url')) {
+ $code->($url);
} else {
- print CLIENTCRAP "%R>>%n Please install openurl.pl";
+ print CLIENTCRAP "%R>>%n Please install openurl.pl";
}
use strict "refs";
}
@@ -377,7 +377,7 @@ sub reload_config() {
my $text;
if (-e $filename) {
local *F;
- open F, "<".$filename;
+ open F, "<",$filename;
$text .= $_ foreach (<F>);
close F;
if ($text) {
@@ -402,7 +402,7 @@ sub reload_config() {
sub save_config() {
local *F;
my $filename = Irssi::settings_get_str('newsline_sites_file');
- open(F, ">$filename");
+ open(F, '>',$filename);
my $dumper = Data::Dumper->new([\%sites], ['sites']);
$dumper->Purity(1)->Deepcopy(1);
my $data = $dumper->Dump;