|
|
|
@ -13,6 +13,7 @@ import (
|
|
|
|
|
"log"
|
|
|
|
|
"net"
|
|
|
|
|
"os"
|
|
|
|
|
"os/signal"
|
|
|
|
|
"strings"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
@ -314,7 +315,6 @@ func main() {
|
|
|
|
|
iqc := make(chan xmpp.IQ, defaultBufferSize)
|
|
|
|
|
msgc := make(chan xmpp.Chat, defaultBufferSize)
|
|
|
|
|
go rcvStanzas(client, iqc, msgc)
|
|
|
|
|
|
|
|
|
|
for _, r := range getopt.Args() {
|
|
|
|
|
var re recipientsType
|
|
|
|
|
re.Jid = r
|
|
|
|
@ -441,6 +441,15 @@ func main() {
|
|
|
|
|
case *flagInteractive:
|
|
|
|
|
// Send in endless loop (for usage with e.g. "tail -f").
|
|
|
|
|
reader := bufio.NewReader(os.Stdin)
|
|
|
|
|
// Quit if ^C is pressed.
|
|
|
|
|
c := make(chan os.Signal, 1)
|
|
|
|
|
signal.Notify(c, os.Interrupt)
|
|
|
|
|
go func() {
|
|
|
|
|
for range c {
|
|
|
|
|
client.Close()
|
|
|
|
|
os.Exit(0)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
for {
|
|
|
|
|
message, err = reader.ReadString('\n')
|
|
|
|
|
message = strings.TrimSuffix(message, "\n")
|
|
|
|
|