-# first lets see if we think we have a callsign as the first argument
-if (defined @f && @f >= 3 && $f[0] =~ /[A-Za-z]/) {
- $spotter = uc $f[0];
+my @bad;
+if (@bad = BadWords::check($line)) {
+ $self->badcount(($self->badcount||0) + @bad);
+ Log('DXCommand', "$self->{call} swore: $line");
+ $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) {
+ $spotter = uc $f[1];
+ $line =~ s/^\s*\Q$f[0]\s+\Q$f[1]\s+//;
+ $line = $f[2];
+ @f = split /\s+/, $line;
+ return (1, $self->msg('dx2')) unless @f >= 2;
+}
+
+# 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];