From: Dirk Koopman Date: Mon, 23 Jul 2007 20:13:16 +0000 (+0100) Subject: prevent empty callsigns on talk X-Git-Tag: 1.55~89 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=19740220d324a319fb868ce34fb7bed7e31dd450;p=spider.git prevent empty callsigns on talk --- diff --git a/cmd/talk.pl b/cmd/talk.pl index 1f7baa30..2d1fbb9e 100644 --- a/cmd/talk.pl +++ b/cmd/talk.pl @@ -28,13 +28,19 @@ if ($via) { ($to, $line) = split /\s+/, $inline, 2; } -$to = uc $to if $to; +return (1, $self->msg('e8')) unless $to; + +$to = uc $to; + +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; +return (1, $self->msg('e22', $to)) unless is_callsign($to); +return (1, $self->msg('e28')) unless $self->registered || $to eq $main::myalias; + $via = uc $via if $via; my $call = $via || $to; my $clref = Route::get($call); # try an exact call my $dxchan = $clref->dxchan if $clref; #return (1, $self->msg('e7', $call)) unless $dxchan; -return (1, $self->msg('e28')) unless $self->registered || $to eq $main::myalias; #$DB::single = 1; diff --git a/perl/Messages b/perl/Messages index 694d61cc..5aaeb4eb 100644 --- a/perl/Messages +++ b/perl/Messages @@ -84,13 +84,13 @@ package DXM; e14 => 'First argument must be numeric and > 0', e15 => 'invalid qualifier \"$_[0]\"', e16 => 'File \"$_[0]\" exists', - e17 => 'Please don\'t use the words: @_ on here', + e17 => 'Please don\'t use the words: @_ on here', e18 => 'Cannot connect to $_[0] ($!)', e19 => 'Invalid character in line', e20 => 'token $_[0] not recognised', - e21 => '$_[0] not numeric', - e22 => '$_[0] not a callsign', - e23 => '$_[0] not a range (eg 0/30000)', + e21 => '$_[0] is not numeric', + e22 => '$_[0] is not a callsign', + e23 => '$_[0] is not a range (eg 0/30000)', e24 => 'Sorry, Internet access is not enabled', e25 => 'Sorry the value must be between $_[0] and $_[1]', e26 => 'Too many concurrent errors, you are being disconnected', @@ -104,6 +104,7 @@ package DXM; e34 => 'Need a GROUP and some text', e35 => 'You are not a member of $_[0], join $_[0]', e36 => 'You can only do this in normal user prompt state', + e37 => 'Need at least a callsign', echoon => 'Echoing enabled', echooff => 'Echoing disabled', diff --git a/perl/Version.pm b/perl/Version.pm index 818d482b..c3627308 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '125'; +$build = '126'; 1;