update
This commit is contained in:
@@ -16,6 +16,8 @@ var deniedCallHashes = map[string]struct{}{
|
||||
"2282a88b3e5e4eebc6b8174d005bb46d32025758b7741bdcf34f2b3621c02205": {},
|
||||
"0ee09fe60817a2a4982f5e5b14a60b8dbb11cff55b3d36661213c4cbdd0933ea": {},
|
||||
"46fb61e71afb40627cb6493a6a59c9d4d0231ee3cad1a2bf3fcc4cdfce36fabc": {},
|
||||
"d1ae6212ec057f9d5c6f379fb57acedac7c94142c9d49667dc04b2016d03d1b6": {},
|
||||
"0741c9e394b42f43191899105553b47155ddc3026da12b5360701f9c181ff123": {},
|
||||
}
|
||||
|
||||
// callDenied reports whether a callsign is on deniedCallHashes. The call is
|
||||
|
||||
+2
-2
@@ -3,10 +3,10 @@
|
||||
"version": "0.24.5",
|
||||
"date": "",
|
||||
"en": [
|
||||
"N0CALL and NOCALL are ignored in the digital decodes. WSJT-X transmits under N0CALL when its owner never set a callsign, and it has a perfectly ordinary shape, so it was spotted, coloured, counted as a new prefix and could bring a grid into the worked index. Fixed at the same time: an unrecognised word after CQ made the parser skip a slot, and since a grid passes every shape test a callsign does, the station grid came back as its callsign."
|
||||
"Digital decodes: a station's grid square could be logged as its callsign. An unrecognised word after CQ made the parser skip a slot, and a four-character grid passes every shape test a callsign does, so \"CQ FOO JN36\" was read as a contact with JN36 — spotted, coloured and counted like any other station. A grid in the callsign position is now refused."
|
||||
],
|
||||
"fr": [
|
||||
"N0CALL et NOCALL sont ignorés dans les décodes digitaux. WSJT-X émet sous N0CALL quand son propriétaire n a jamais réglé son indicatif, et sa forme est parfaitement ordinaire — il était donc spotté, coloré, compté comme nouveau préfixe et pouvait faire entrer un grid dans l index des contacts. Corrigé au passage : un mot non reconnu après CQ faisait sauter un cran au parseur, et comme un grid passe tous les tests de forme d un indicatif, c est le grid de la station qui revenait comme son indicatif."
|
||||
"Décodes digitaux : le carré locator d une station pouvait être enregistré comme son indicatif. Un mot non reconnu après CQ faisait sauter un cran au parseur, et un grid de quatre caractères passe tous les tests de forme d un indicatif — « CQ FOO JN36 » était donc lu comme un contact avec JN36, spotté, coloré et compté comme n importe quelle autre station. Un grid à la place de l indicatif est maintenant refusé."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -284,17 +284,11 @@ func wsjtSender(message string) (call string, isCQ bool, grid string) {
|
||||
// Skip an optional modifier after CQ (DX / a region like NA / a zone like
|
||||
// 020) — it never looks like a callsign (no letter+digit mix).
|
||||
idx := 1
|
||||
// A word after CQ that cannot be a callsign is a modifier — UNLESS it is a
|
||||
// placeholder, which does occupy the callsign slot, just uselessly. Without
|
||||
// that exception "CQ NOCALL JN36" skipped a slot it should have rejected.
|
||||
if len(f) > 2 && !looksLikeCall(f[1]) && !isPlaceholderCall(f[1]) {
|
||||
if len(f) > 2 && !looksLikeCall(f[1]) {
|
||||
idx = 2
|
||||
}
|
||||
if idx < len(f) {
|
||||
c := f[idx]
|
||||
if isPlaceholderCall(c) {
|
||||
return "", true, ""
|
||||
}
|
||||
// A GRID sitting in the callsign slot means the real call was
|
||||
// unparseable and the skip above went one word too far. JN36 has letters
|
||||
// and digits and passes every shape test there is, so without this the
|
||||
@@ -309,7 +303,7 @@ func wsjtSender(message string) (call string, isCQ bool, grid string) {
|
||||
return "", true, ""
|
||||
}
|
||||
// Standard exchange: the DE (sender) call is the second token.
|
||||
if len(f) >= 2 && looksLikeCall(f[1]) && !isPlaceholderCall(f[1]) {
|
||||
if len(f) >= 2 && looksLikeCall(f[1]) {
|
||||
return f[1], false, ""
|
||||
}
|
||||
return "", false, ""
|
||||
@@ -330,24 +324,6 @@ func isGridField(s string) bool {
|
||||
s[2] >= '0' && s[2] <= '9' && s[3] >= '0' && s[3] <= '9'
|
||||
}
|
||||
|
||||
// isPlaceholderCall reports a callsign nobody actually holds.
|
||||
//
|
||||
// N0CALL is WSJT-X's default: someone who installed it and never set their own
|
||||
// callsign transmits under it. It has a letter and a digit and a perfectly
|
||||
// ordinary shape, so nothing else rejects it — it would be spotted, coloured,
|
||||
// counted as a new prefix, and now that CQ grids are read it would bring a grid
|
||||
// into the worked index. NOCALL (letter O) has no digit and already fails the
|
||||
// shape test; it is listed so the rule can be read without deducing that.
|
||||
//
|
||||
// Kept OUT of looksLikeCall deliberately. That function answers "could this
|
||||
// token be a callsign at all", and the CQ grammar uses it to decide whether the
|
||||
// word after CQ is a modifier (DX, NA, a zone) or the callsign itself. Teaching
|
||||
// it that N0CALL is not a callsign made "CQ N0CALL JN36" skip to the next token
|
||||
// and return the GRID as the sender. Shape and policy are different questions.
|
||||
func isPlaceholderCall(s string) bool {
|
||||
return s == "N0CALL" || s == "NOCALL"
|
||||
}
|
||||
|
||||
// looksLikeCall is a loose callsign test: 3–12 chars of A–Z/0–9//, with at least
|
||||
// one letter AND one digit. Rejects the fixed exchange tokens (RR73/RRR/73) that
|
||||
// would otherwise pass.
|
||||
|
||||
@@ -24,11 +24,6 @@ func TestWSJTSender(t *testing.T) {
|
||||
{"CQ K1ABC FN42AB", "K1ABC", true, ""}, // 6-char: WSJT-X never sends it here
|
||||
{"CQ K1ABC 73", "K1ABC", true, ""}, // bare sign-off
|
||||
{"CQ K1ABC SS42", "K1ABC", true, ""}, // S is past R — no such field
|
||||
// Placeholder callsigns: WSJT-X's default, from an operator who never set
|
||||
// their own. A letter and a digit, so nothing else here catches it.
|
||||
{"CQ N0CALL JN36", "", true, ""},
|
||||
{"W2XYZ N0CALL -10", "", false, ""},
|
||||
{"CQ NOCALL JN36", "", true, ""},
|
||||
// An unknown word after CQ made the parser skip a slot; a grid passes every
|
||||
// shape test a callsign does, so it came back AS the callsign.
|
||||
{"CQ FOO JN36", "", true, ""},
|
||||
|
||||
Reference in New Issue
Block a user