Add support for parsing To/Cc fields and passing an array
of addresses back to the compose window.
Improve handling of Msg. As per the templates [spec][]:
> Msg: -- Start of message body. All text following Msg: is placed in the body of the message.
and a few templates have text and variables on the same line as the "Msg:".
Therefore, simply strip out the Msg: and use that to mark the rest of
the template as being part of the body.
[spec]: http://www.philsherrod.com/Winlink/RMS_Express_Message_Templates.pdf
[Changed "var inBody = true" to "inBody := true" per Martin's
suggestion]
Signed-off-by: Corey Minyard <cminyard@mvista.com>
By doing graceful shutdown, we're able to properly close all of the open
resources such as modem connections and ongoing sessions.
This will allow transport drivers controlling stateful TNCs (e.g.
ptc-go) to recover the initial TNC state before termination.
Resolves#314
* Deprecate `forms_path` in the config file and replace with `--forms` flag
* Clean up `optionsSet()` to show correct defaults
* Clean up places that detected when `forms_path` was not configured (before it had a default)
Resolves https://github.com/la5nta/pat/issues/287
* Replace(..., -1) with ReplaceAll
* Variable names hiding packages
* Error messages start with lowercase and no end punctuation
* Don't `defer` in a loop
* Etc.
When a form .txt file only specifies one HTML template, it's supposed to be used for both compose and view.
Also fix a Javascript error. Now that "RADIOGRAM & RRI Forms" is coming through, we can't have ampersand in an HTML element ID.
This primes the user to run a forms update with zero configuration, but doesn't actually do it for them. This could cause errors if they try to use forms before running the update. With some more work, we could make this more like the RMS list where the update happens proactively. For now, I think this is good enough.
Fixes#256
* Call resp.Body.Close()
* Don't log errors, return them to caller
* More idiomatic variable names
* Reuse single http.Client instance, and wrapper for Get call
* Stop using ioutil
* Don't Panic(TM)
* Fetch latest version info over HTTPS
Still need to address bugs around caching and un-configured forms path.