+my @bad;
+if (@bad = BadWords::check($line)) {
+ $self->badcount(($self->badcount||0) + @bad);
+ LogDbg('DXCommand', "$self->{call} swore: $line (with words:" . join(',', @bad) . ")");
+ $localonly++;
+}
+
+# do we have at least two args?
+return (1, $self->msg('dx2')) unless @f >= 2;
+
+# as a result of a suggestion by Steve K9AN, I am changing the syntax of
+# 'spotted by' things to "dx by g1tlh <freq> <call>" <freq> and <call>
+# can be in any order
+
+if ($f[0] =~ /^by$/i) {
+ return (1, $self->msg('e5')) unless $main::allowdxby || $self->priv > 1;
+ $spotter = uc $f[1];
+ $line =~ s/^\s*$f[0]\s+$f[1]\s+//;
+ @f = split /\s+/, $line, 3;
+ return (1, $self->msg('dx2')) unless @f >= 2;
+}
+
+my $ipaddr;
+@f = split /\s+/, $line, 3;
+if ($f[0] eq 'ip') {
+ return (1, $self->msg('e5')) unless $spotter && $self->priv > 1;
+ if (is_ipaddr($f[1])) {
+ $ipaddr = $f[1];
+ } else {
+ return (1, $self->msg('dx4', $f[1]));
+ }
+ $line =~ s/^\s*$f[0]\s+$f[1]\s+//;
+ @f = split /\s+/, $line, 3;
+}
+
+
+# get the freq and callsign either way round
+if (is_freq($f[1]) && $f[0] =~ m{^[\w\d]+(?:/[\w\d]+){0,2}$}) {
+ $spotted = uc $f[0];