diff options
author | xengineering <me@xengineering.eu> | 2023-06-30 20:40:47 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-06-30 20:40:47 +0200 |
commit | dee833b803494ce962c577ddf950795a2fd490ae (patch) | |
tree | f353e8c8d653d9d94ab7e45a624ac8bd27f0e32f /xmpp/presence.go | |
parent | e2c057571ae309cf503851ab8f63c2159f2ef4bc (diff) | |
download | limox-dee833b803494ce962c577ddf950795a2fd490ae.tar limox-dee833b803494ce962c577ddf950795a2fd490ae.tar.zst limox-dee833b803494ce962c577ddf950795a2fd490ae.zip |
Send initial presence after resource result
This completes the connection process.
Diffstat (limited to 'xmpp/presence.go')
-rw-r--r-- | xmpp/presence.go | 24 |
1 files changed, 24 insertions, 0 deletions
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 + } + } +} |