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/presence.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 xmpp/presence.go (limited to 'xmpp/presence.go') diff --git a/xmpp/presence.go b/xmpp/presence.go new file mode 100644 index 0000000..b6ea3b5 --- /dev/null +++ b/xmpp/presence.go @@ -0,0 +1,24 @@ +package xmpp + +import ( + "encoding/xml" + "log" +) + +func (s *session) sendPresence() { + start := xml.StartElement{ + xml.Name{"", "presence"}, + []xml.Attr{}, + } + end := start.End() + + tokens := [...]xml.Token{start, end} + + for _, v := range tokens { + err := s.ed.encodeToken(v) + if err != nil { + log.Println("Could not encode presence!") + return + } + } +} -- cgit v1.2.3-70-g09d2