diff options
author | xengineering <me@xengineering.eu> | 2023-06-30 20:43:12 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-06-30 20:43:25 +0200 |
commit | 0774275597131badfba5045b14f9632a78d063e8 (patch) | |
tree | 51d302e473b5474de8ed74dad42a387fa3e441fb /xmpp/presence.go | |
parent | e2c057571ae309cf503851ab8f63c2159f2ef4bc (diff) | |
parent | ff92af1410f3c37c6cfa5fb7ff6e322c8d691121 (diff) | |
download | limox-0774275597131badfba5045b14f9632a78d063e8.tar limox-0774275597131badfba5045b14f9632a78d063e8.tar.zst limox-0774275597131badfba5045b14f9632a78d063e8.zip |
Merge branch 'initial-presence'
This broadcasts that the LimoX client is ready for communication.
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 + } + } +} |