From dee833b803494ce962c577ddf950795a2fd490ae Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 30 Jun 2023 20:40:47 +0200 Subject: Send initial presence after resource result This completes the connection process. --- xmpp/jid.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xmpp/jid.go') 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"}, }, } -- cgit v1.2.3-70-g09d2