diff --git a/src/xmpp/remoteRosterManager.go b/src/xmpp/remoteRosterManager.go new file mode 100644 index 0000000..83ce91b --- /dev/null +++ b/src/xmpp/remoteRosterManager.go @@ -0,0 +1,21 @@ +package xmpp + +import ( + "encoding/xml" +) + +const ( + NSRemoteRosterManager = "urn:xmpp:tmp:roster-management:0" + + RemoteRosterManagerTypeRequest = "request" + RemoteRosterManagerTypeAllowed = "allowed" + RemoteRosterManagerTypeRejected = "rejected" +) + +// XEP-0321: Remote Roster Manager + +type RemoteRosterManagerQuery struct { + XMLName xml.Name `xml:"urn:xmpp:tmp:roster-management:0 query"` + Reason string `xml:"reason,attr,omitempty"` + Type string `xml:"type,attr"` +} diff --git a/src/xmpp/roster.go b/src/xmpp/roster.go new file mode 100644 index 0000000..19272b9 --- /dev/null +++ b/src/xmpp/roster.go @@ -0,0 +1,26 @@ +package xmpp + +import ( + "encoding/xml" +) + +const ( + NSRoster = "jabber:iq:roster" + + RosterSubscriptionBoth = "both" + RosterSubscriptionFrom = "from" + RosterSubscriptionTo = "to" + RosterSubscriptionRemove = "remove" +) + +type RosterQuery struct { + XMLName xml.Name `xml:"jabber:iq:roster query"` + Items []RosterItem `xml:"item"` +} + +type RosterItem struct { + JID string `xml:"jid,attr"` + Name string `xml:"name,attr,omitempty"` + Subscription string `xml:"subscription,attr"` + Groupes []string `xml:"group"` +}