summaryrefslogtreecommitdiff
path: root/xmpp/streams.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-07-04 22:04:05 +0200
committerxengineering <me@xengineering.eu>2023-07-04 22:04:05 +0200
commita23ba089a4e715e68b8c8d4179290692215784a2 (patch)
treef7c13f78ff728b9e0e59045f1709907c29c55e37 /xmpp/streams.go
parented6b4e818f4090c0c707fab49093bc4c3cc3ac20 (diff)
downloadlimox-a23ba089a4e715e68b8c8d4179290692215784a2.tar
limox-a23ba089a4e715e68b8c8d4179290692215784a2.tar.zst
limox-a23ba089a4e715e68b8c8d4179290692215784a2.zip
Re-implement resource binding and presence
This was removed for refactoring.
Diffstat (limited to 'xmpp/streams.go')
-rw-r--r--xmpp/streams.go8
1 files changed, 8 insertions, 0 deletions
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) {