@ -3,6 +3,7 @@
## UNRELEASED
### Changed
- Properly close stream if `Ctrl+C` is pressed in interactive mode.
- Properly close stream if `Ctrl+C` is pressed in listening mode.
- Print OS, architecture and go version for flag `--version`.
- Improve closing of connection.
@ -38,6 +38,7 @@ func closeAndExit(client *xmpp.Client, cancel context.CancelFunc, err error) {
if err != nil {
log.Fatal(err)
}
os.Exit(0)
func readMessage(messageFilePath string) (string, error) {
@ -519,6 +520,14 @@ func main() {
case *flagListen:
tz := time.Now().Location()
// Quit if ^C is pressed.
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
for range c {
closeAndExit(client, cancel, nil)
}()
for {
v := <-msgc
switch {