Closed caver456 closed 2 months ago
don't bother logging a change-of-callsign message on the first change, i.e. if the thing it is being changed from has no entries, or is the default callsign for that device.
There are really two changes happening when a callsign is changed:
1) the callsign for the current message is changed 2) possibly, the callsign association of a given device is changed
1 could be indicated by '[CALLSIGN CHANGED FOR THIS MESSAGE: WAS "Team 101", CHANGED TO "Rescue 101"]' 2 could be indicated by '[CALLSIGN CHANGED FOR DEVICE 100:3030: WAS "Team 101", CHANGED TO "Rescue 101"]'
When changed via CCD, both 1 and 2 will happen. When changed by typing in the callsign field, only 1 will happen.
Is the 'changed to' clause important? It will be equal to the saved entry's callsign. Maybe 'CALLSIGN FOR THIS MESSAGE CHANGED FROM ...' or 'CALLSIGN FOR DEVICE 100:3030 CHANGED FROM ...'
Taken out of context, a note that a device's callsign got changed isn't that helpful. Should probably add wording to say that this message was spawned from the device in question.
These callsign change messages are only relevant for FS/NXDN incoming calls.
How bout:
[CALLSIGN CHANGE: THIS CALL IS FROM DEVICE 100:3030, PREVIOUSLY "Team 101"]
and on Team 101, save an entry [CALLSIGN CHANGE: DEVICE 100:3030, PREVIOUSLY ON THIS CALLSIGN, CHANGED TO "Rescue 101"; see new entry under that callsign]
Since the note is wordy, and is probably not the main purpose of the message, seems like it should be appended to the end of the message body, rather than prepended. Not sure if there's any easy way to append it at message-accept-time.
should also account for the case when CCD is called multiple times in the same message, i.e. if the operator isn't quite clear on what the final callsign should be. This would mean keeping track of callsign-at-spawn vs callsign-at-accept.
We don't want to save a separate entry for the new callsign before the real message is actually saved with that new callsign, since this could create a new tab that may actually have no real content (if the message is canceled or if the callsign is changed again before accepting). See the previous suggestion about remembering callsign-at-spawn vs callsign-at-accept.
Got momentum with this concept - making a branch and doing a commit:
Maybe CCD1List isn't the right way to filter out the change-of-callsign message: there might actually be real entries from a default callsign.
Probably a better way to filter is to see if there are any existing entries from the original callsign.
Changed filter method to check self.parent.allTeamsList
Added an entry for the previous callsign
Should be ready for testing:
allTeamsList gets some default callsign syntax wrong, which means that a change callsign message away from that default callsign is not generated. This happens for NXDN and for FS. Example of allTeamsList after saving some default callsign messages:
allTeamsList=['Team 101', 'Team 102', 'Team 103', 'Team 111', 'Kw- 100-5568', 'Kw-nxdn- 2002']
(teamNameList has the same syntax issues)
when the original callsign names it is looking for are 'KW-100-5568' and 'KW-NXDN-02002'.
See how complicated it is to modify the generation of allTeamsList, at least so that default callsigns are preserved verbatim.
Simple edit to getNiceTeamName to preserve uppercase name verbatim if it starts with 'KW-' (case-insensitive comparison, since it's probably already 'Kw-' when getNiceTeamName is called)
This idea came from the MRA mock 8/17/24, when e.g. 'team 101' becomes 'rescue group' or such. Team 101 tab and entries are preserved, and RescueGroup tab is created, but both tabs should probably have automatic entries stating the change of callsign.