+ # remove ssids if present on spotter
+ $out[4] =~ s/-\d+$//o;
+
+ # remove leading and trailing spaces
+ $_[3] = unpad($_[3]);
+
+ my ($spotted_dxcc, $spotted_itu, $spotted_cq, $spotted_state) = (666, 0, 0, "");
+ my ($spotter_dxcc, $spotter_itu, $spotter_cq, $spotter_state) = (666, 0, 0, "");
+
+ # add the 'dxcc' country on the end for both spotted and spotter, then the cluster call
+ my @dxcc = Prefix::extract($out[1]);
+ if (@dxcc) {
+ $spotted_dxcc = $dxcc[1]->dxcc();
+ $spotted_itu = $dxcc[1]->itu();
+ $spotted_cq = $dxcc[1]->cq();
+ $spotted_state = $dxcc[1]->state();
+ }
+ push @out, $spotted_dxcc;
+ @dxcc = Prefix::extract($out[4]);
+ if (@dxcc) {
+ $spotter_dxcc = $dxcc[1]->dxcc();
+ $spotter_itu = $dxcc[1]->itu();
+ $spotter_cq = $dxcc[1]->cq();
+ $spotter_state = $dxcc[1]->state();
+ }
+ push @out, $spotter_dxcc;
+ push @out, $_[5];
+ return (@out, $spotted_itu, $spotted_cq, $spotter_itu, $spotter_cq, $spotted_state, $spotter_state);
+}
+
+sub add
+{
+ my $buf = join("\^", @_[0..7]);
+ $fp->writeunix($_[2], $buf);
+ $totalspots++;
+ if ($_[0] <= 30000) {
+ $hfspots++;
+ } else {
+ $vhfspots++;
+ }
+ if ($_[3] =~ /(?:QSL|VIA)/i) {
+ my $q = QSL::get($_[1]) || new QSL $_[1];
+ $q->update($_[3], $_[2], $_[4]);
+ }