aboutsummaryrefslogtreecommitdiff
path: root/xmpp/extensions/extensions.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/extensions/extensions.go')
-rw-r--r--xmpp/extensions/extensions.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/xmpp/extensions/extensions.go b/xmpp/extensions/extensions.go
index 192b630..8e2f743 100644
--- a/xmpp/extensions/extensions.go
+++ b/xmpp/extensions/extensions.go
@@ -193,6 +193,26 @@ type Replace struct {
Id string `xml:"id,attr"`
}
+// QueryRegister is from XEP-0077
+type QueryRegister struct {
+ XMLName xml.Name `xml:"jabber:iq:register query"`
+ Instructions string `xml:"instructions"`
+ Username string `xml:"username"`
+ Registered *QueryRegisterRegistered `xml:"registered"`
+ Remove *QueryRegisterRemove `xml:"remove"`
+ ResultSet *stanza.ResultSet `xml:"set,omitempty"`
+}
+
+// QueryRegisterRegistered is a child element from XEP-0077
+type QueryRegisterRegistered struct {
+ XMLName xml.Name `xml:"registered"`
+}
+
+// QueryRegisterRemove is a child element from XEP-0077
+type QueryRegisterRemove struct {
+ XMLName xml.Name `xml:"remove"`
+}
+
// Namespace is a namespace!
func (c PresenceNickExtension) Namespace() string {
return c.XMLName.Space
@@ -248,6 +268,16 @@ func (c Replace) Namespace() string {
return c.XMLName.Space
}
+// Namespace is a namespace!
+func (c QueryRegister) Namespace() string {
+ return c.XMLName.Space
+}
+
+// GetSet getsets!
+func (c QueryRegister) GetSet() *stanza.ResultSet {
+ return c.ResultSet
+}
+
// Name is a packet name
func (ClientMessage) Name() string {
return "message"
@@ -326,4 +356,10 @@ func init() {
"urn:xmpp:message-correct:0",
"replace",
}, Replace{})
+
+ // register query
+ stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{
+ "jabber:iq:register",
+ "query",
+ }, QueryRegister{})
}