diff options
Diffstat (limited to 'xmpp/presence.go')
-rw-r--r-- | xmpp/presence.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/xmpp/presence.go b/xmpp/presence.go index b6ea3b5..4adae6e 100644 --- a/xmpp/presence.go +++ b/xmpp/presence.go @@ -5,20 +5,17 @@ import ( "log" ) +type presence struct{} + 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 - } + err := s.ed.tx.EncodeElement(presence{}, start) + if err != nil { + log.Println("Could not encode presence!") + return } } |