summaryrefslogtreecommitdiff
path: root/xmpp/jid.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-06-30 20:40:47 +0200
committerxengineering <me@xengineering.eu>2023-06-30 20:40:47 +0200
commitdee833b803494ce962c577ddf950795a2fd490ae (patch)
treef353e8c8d653d9d94ab7e45a624ac8bd27f0e32f /xmpp/jid.go
parente2c057571ae309cf503851ab8f63c2159f2ef4bc (diff)
downloadlimox-dee833b803494ce962c577ddf950795a2fd490ae.tar
limox-dee833b803494ce962c577ddf950795a2fd490ae.tar.zst
limox-dee833b803494ce962c577ddf950795a2fd490ae.zip
Send initial presence after resource result
This completes the connection process.
Diffstat (limited to 'xmpp/jid.go')
-rw-r--r--xmpp/jid.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmpp/jid.go b/xmpp/jid.go
index 0446d19..fd0d7ae 100644
--- a/xmpp/jid.go
+++ b/xmpp/jid.go
@@ -57,10 +57,12 @@ func hasBind(e []xml.Token) bool {
}
func (s *session) sendBind() {
+ s.resourceReq = fmt.Sprintf("%016x", rand.Uint64())
+
iqStart := xml.StartElement{
xml.Name{"jabber:client", "iq"},
[]xml.Attr{
- xml.Attr{xml.Name{"", "id"}, fmt.Sprintf("%016x", rand.Uint64())},
+ xml.Attr{xml.Name{"", "id"}, s.resourceReq},
xml.Attr{xml.Name{"", "type"}, "set"},
},
}