From a23ba089a4e715e68b8c8d4179290692215784a2 Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 4 Jul 2023 22:04:05 +0200 Subject: Re-implement resource binding and presence This was removed for refactoring. --- xmpp/streams.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xmpp/streams.go') diff --git a/xmpp/streams.go b/xmpp/streams.go index b9cd4cd..18a5e6a 100644 --- a/xmpp/streams.go +++ b/xmpp/streams.go @@ -7,9 +7,12 @@ import ( type streamFeatures struct { SaslMechanisms []string `xml:"urn:ietf:params:xml:ns:xmpp-sasl mechanisms>mechanism"` + Bind *bool `xml:"urn:ietf:params:xml:ns:xmpp-bind bind,omitempty"` } func handleStreamFeatures(s *session, f streamFeatures) { + log.Print(f) + if len(f.SaslMechanisms) > 0 { for _, v := range f.SaslMechanisms { if v == "PLAIN" { @@ -20,6 +23,11 @@ func handleStreamFeatures(s *session, f streamFeatures) { log.Println("No compatible SASL mechanism found!") return } + + if f.Bind != nil { + s.sendBind() + return + } } func openStream(e *xml.Encoder, jid string) { -- cgit v1.2.3-70-g09d2