From 3f893069092cc6ebc320398d35ff31956becb505 Mon Sep 17 00:00:00 2001 From: Thomas Maier Date: Sun, 5 Jan 2020 13:30:06 +0100 Subject: [PATCH 1/3] Ignore some errors explicitly --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index ed3b306..d1944c8 100644 --- a/main.go +++ b/main.go @@ -60,8 +60,8 @@ func initXMPP(address jid.JID, pass string, skipTLSVerify bool, useXMPPS bool) ( } func closeXMPP(session *xmpp.Session) { - session.Close() - session.Conn().Close() + _ = session.Close() + _ = session.Conn().Close() } func main() { @@ -150,5 +150,5 @@ func main() { http.Handle("/grafana", newMessageHandler(messages, grafanaParserFunc)) // listen for requests - http.ListenAndServe(":4321", nil) + _ = http.ListenAndServe(":4321", nil) } From 8bf309a189a1288e1a3f830623ce2ffef2c69d3f Mon Sep 17 00:00:00 2001 From: Thomas Maier Date: Sun, 5 Jan 2020 13:31:30 +0100 Subject: [PATCH 2/3] Send messages as Type stanza.ChatMessage --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index d1944c8..c2bec75 100644 --- a/main.go +++ b/main.go @@ -114,7 +114,8 @@ func main() { // create reply with identical contents reply := MessageBody{ Message: stanza.Message{ - To: msg.From.Bare(), + To: msg.From.Bare(), + Type: stanza.ChatMessage, }, Body: msg.Body, } @@ -138,7 +139,8 @@ func main() { // try to send message, ignore errors _ = xmppSession.Encode(MessageBody{ Message: stanza.Message{ - To: recipient, + To: recipient, + Type: stanza.ChatMessage, }, Body: m, }) From 90dd350a7ee129abcc10e8a70c181d7a180f2c8d Mon Sep 17 00:00:00 2001 From: Thomas Maier Date: Sun, 5 Jan 2020 13:43:27 +0100 Subject: [PATCH 3/3] Activate support for SCRAM-SHA-256 and SCRAM-SHA-256-PLUS in mellium-xmpp --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index c2bec75..916d306 100644 --- a/main.go +++ b/main.go @@ -54,7 +54,7 @@ func initXMPP(address jid.JID, pass string, skipTLSVerify bool, useXMPPS bool) ( xmpp.NewNegotiator(xmpp.StreamConfig{Features: []xmpp.StreamFeature{ xmpp.BindResource(), xmpp.StartTLS(false, &tlsConfig), - xmpp.SASL("", pass, sasl.ScramSha1Plus, sasl.ScramSha1, sasl.Plain), + xmpp.SASL("", pass, sasl.ScramSha256Plus, sasl.ScramSha256, sasl.ScramSha1Plus, sasl.ScramSha1, sasl.Plain), }}), ) }