Due to the fact that cmdr and entry are only assigned if item exists, a
situation can arise where any access to the names will raise an
UnboundLocalException, this tells the type checker to ignore that
possibility by using a TYPE_CHECKING guarded assignment to those names.
This does not fix the issue at runtime, it just tells the type checker
that its fine. As this remains a bug, I have left TODOs in to note its
existence.
FSDTarget contains the target system under `SystemAddress`, meaning that
any time you selected a star other than the current one, plugins'
`this.system_address` was updated to that target, rather than the
current system. Said updating causes the links provided from system_url
to reflect that update (for providers that support ID64s).
This changes the journal_entry behaviour to only update
`this.system_address` when the event is any of Location, Docked,
or FSDJump, all of which contain only the current system.
* If you request docking successfully then show the station namd and
have the link work.
* This is then only undone if you:
1) Dock and undock
2) Supercruise away
3) Jump away
It is *not* undone if you simply cancel the docking request.
Tested only with same provider for system and station for each of the
three, not the other 6 combinations.
* Make all plugins use `requests.utils.requote_uri()`
* Make all plugins use roughly the same logic, without if/else trees
(as the bodies do a `return ...`), ending with `return ''` if input
parameters are None.
This throws away the inara fallback to `this.station or this.system` as
it's unlikely the in-plugin tracking did a better job than the
monitor.py code.