diff options
| author | David Leadbeater | 2014-10-13 16:07:42 +0100 |
|---|---|---|
| committer | David Leadbeater | 2014-10-13 16:07:42 +0100 |
| commit | fb97387fbd4604e2b3c95cb421276ca43b181cab (patch) | |
| tree | ea06d930157883b3b84e4892935247ece7d2f83f | |
| parent | c4488751a63333d5cc07e91d41bdd314e1943301 (diff) | |
| parent | f3a3a6e9a9264f2a5e4a9cfe4e529f01441e9ef1 (diff) | |
| download | scripts.irssi.org-fb97387fbd4604e2b3c95cb421276ca43b181cab.tar.bz2 | |
Merge pull request #48 from pierrot14/fix_u
Fix u.pl
| -rw-r--r-- | _data/scripts.yaml | 2 | ||||
| -rw-r--r-- | scripts/u.pl | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/_data/scripts.yaml b/_data/scripts.yaml index 175cf45..886298a 100644 --- a/_data/scripts.yaml +++ b/_data/scripts.yaml @@ -3831,7 +3831,7 @@ license: "GNU GPL" name: "List nicks in channel" url: "http://otoria.freecode.nl/~michiel/u.pl" - version: "1.2" + version: "1.3" - authors: "Peder Stray" contact: "peder@ninja.no" diff --git a/scripts/u.pl b/scripts/u.pl index a552da7..e785c76 100644 --- a/scripts/u.pl +++ b/scripts/u.pl @@ -1,7 +1,7 @@ use vars qw($VERSION %IRSSI); use Irssi 20020120; -$VERSION = "1.2"; +$VERSION = "1.3"; %IRSSI = ( authors => "Michiel", contact => "michiel\@dotgeek.org", @@ -12,7 +12,6 @@ $VERSION = "1.2"; changed => "Thu Jun 3 11:04:27 CEST 2004", ); - sub cmd_u { my ($data, $server, $channel) = @_; @@ -21,12 +20,18 @@ sub cmd_u my $msg; my $match; my $nick; - + if ($channel->{type} ne "CHANNEL") { Irssi::print("You are not on a channel"); return; } + + eval { /$data/ } ; + if ($@) { + Irssi::print("Not a valid regexp given.",MSGLEVEL_CLIENTERROR); + return; + } @nicks = $channel->nicks(); @@ -60,7 +65,7 @@ sub cmd_u } $match = $nick->{nick}.'!'.$nick->{host}; # For regexp matching - + $channel->print($msg) if $match =~ /$data/i; } |
