1
0
Fork 0

Add support of Remote Roster Manager (XEP-0321).

This commit is contained in:
Chteufleur 2016-10-05 21:26:42 +02:00
parent 7d5b58fc8d
commit 0490e0a087
2 changed files with 47 additions and 0 deletions

View File

@ -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"`
}

26
src/xmpp/roster.go Normal file
View File

@ -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"`
}