Merge branch 'slack-handler' into master

master
Thomas Maier 2020-01-05 15:11:33 +01:00 zatwierdzone przez GitHub
commit 04686fc587
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 4 usunięć

10
main.go
Wyświetl plik

@ -54,14 +54,14 @@ 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),
}}),
)
}
func closeXMPP(session *xmpp.Session) {
session.Close()
session.Conn().Close()
_ = session.Close()
_ = session.Conn().Close()
}
func main() {
@ -116,6 +116,7 @@ func main() {
Message: stanza.Message{
To: msg.From.Bare(),
From: address,
Type: stanza.ChatMessage,
},
Body: msg.Body,
}
@ -141,6 +142,7 @@ func main() {
Message: stanza.Message{
To: recipient,
From: address,
Type: stanza.ChatMessage,
},
Body: m,
})
@ -153,5 +155,5 @@ func main() {
http.Handle("/slack", newMessageHandler(messages, slackParserFunc))
// listen for requests
http.ListenAndServe(":4321", nil)
_ = http.ListenAndServe(":4321", nil)
}