sum7
/
yaja
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
yaja/messages/iq.go

49 lines
1.1 KiB
Go
Raw Normal View History

2017-12-14 21:30:07 +01:00
package messages
2018-02-10 13:34:42 +01:00
import (
"encoding/xml"
"dev.sum7.eu/genofire/yaja/model"
)
2017-12-14 21:30:07 +01:00
type IQType string
const (
IQTypeGet IQType = "get"
IQTypeSet IQType = "set"
IQTypeResult IQType = "result"
IQTypeError IQType = "error"
)
// IQ element - info/query
type IQClient struct {
2018-02-10 13:34:42 +01:00
XMLName xml.Name `xml:"jabber:client iq"`
From *model.JID `xml:"from,attr"`
ID string `xml:"id,attr"`
To *model.JID `xml:"to,attr"`
Type IQType `xml:"type,attr"`
Error *ErrorClient `xml:"error"`
Bind *Bind
Ping *Ping
PrivateQuery *IQPrivateQuery
PrivateRegister *IQPrivateRegister
// Any hasn't matched element
Other []XMLElement `xml:",any"`
}
type Ping struct {
XMLName xml.Name `xml:"urn:xmpp:ping ping"`
}
type IQPrivateQuery struct {
XMLName xml.Name `xml:"jabber:iq:private query"`
Body []byte `xml:",innerxml"`
}
type IQPrivateRegister struct {
XMLName xml.Name `xml:"jabber:iq:register query"`
Instructions string `xml:"instructions"`
Username string `xml:"username"`
Password string `xml:"password"`
2017-12-14 21:30:07 +01:00
}