prevent empty callsigns on talk
authorDirk Koopman <djk@tobit.co.uk>
Mon, 23 Jul 2007 20:13:16 +0000 (21:13 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Mon, 23 Jul 2007 20:13:16 +0000 (21:13 +0100)
cmd/talk.pl
perl/Messages
perl/Version.pm

index 1f7baa30c2fd744c75a1e41db5eb55268593b568..2d1fbb9ef27d402c1e441d2731951aa6c9d56a96 100644 (file)
@@ -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;
 
index 694d61cccb0ac10857c24321cffc1da32bf78e54..5aaeb4eb39460cf23c3bb8a1833eb309a97dd6df 100644 (file)
@@ -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',
index 818d482b104369a95584a2dd1223c726c0f6c8bb..c362730893ff7b111cd9747677edcc155cab7670 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '125';
+$build = '126';
 
 1;