M go.mod => go.mod +5 -1
@@ 2,4 2,8 @@ module code.fl9.eu/xmpp-toolbox
go 1.13
-require gosrc.io/xmpp v0.3.0
+require (
+ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
+ gosrc.io/xmpp v0.4.0
+ nhooyr.io/websocket v1.7.4 // indirect
+)
M main.go => main.go +2 -2
@@ 41,14 41,14 @@ func main() {
var listen = flag.Bool("listen", false, "If specified, will connect to XMPP and print incoming messages to the console")
var messageRecipent = flag.String("recipent", "", "If specified, a messages from STDIN will be sent to provided JID")
- var recipentJid *xmpp.Jid = nil
+ var recipentJid *stanza.Jid = nil
var err error
optionChosen := false
flag.Parse()
if (len(*messageRecipent) > 0) {
- recipentJid, err = xmpp.NewJid(*messageRecipent)
+ recipentJid, err = stanza.NewJid(*messageRecipent)
if (err != nil) {
log.Fatalf("Invalid JID provided as recipent: %s", err)
}
M xmpp.go => xmpp.go +3 -1
@@ 1,6 1,8 @@
package main
import (
+ "log"
+
"gosrc.io/xmpp"
"gosrc.io/xmpp/stanza"
)
@@ 44,7 46,7 @@ func CreateXMPPConnection(serverAddress string, jid string, password string, sen
router := xmpp.NewRouter()
- client, err := xmpp.NewClient(config, router)
+ client, err := xmpp.NewClient(config, router, func(e error){ log.Fatalf("Connection error: %s", e) })
if err != nil {
return XmppConnection{cm: nil, client: nil, router: nil}, err
}