summaryrefslogtreecommitdiff
path: root/xmpp/presence.go
blob: b6ea3b5b35d4eed97c07cf35af6bfe0e92f4a9a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
		}
	}
}