roster.go
changeset 75 03a923eb5c01
parent 74 e619e18dcec3
equal deleted inserted replaced
74:e619e18dcec3 75:03a923eb5c01
    16 var rosterExt Extension = Extension{StanzaHandlers: map[string]func(*xml.Name) interface{}{NsRoster: newRosterQuery}, Start: startRosterFilter}
    16 var rosterExt Extension = Extension{StanzaHandlers: map[string]func(*xml.Name) interface{}{NsRoster: newRosterQuery}, Start: startRosterFilter}
    17 
    17 
    18 // Roster query/result
    18 // Roster query/result
    19 type RosterQuery struct {
    19 type RosterQuery struct {
    20 	XMLName xml.Name `xml:"jabber:iq:roster query"`
    20 	XMLName xml.Name `xml:"jabber:iq:roster query"`
    21 	Item    []RosterItem
    21 	Item    []RosterItem `xml:"item"`
    22 }
    22 }
    23 
    23 
    24 // See RFC 3921, Section 7.1.
    24 // See RFC 3921, Section 7.1.
    25 type RosterItem struct {
    25 type RosterItem struct {
    26 	XMLName      xml.Name `xml:"item"`
    26 	XMLName      xml.Name `xml:"item"`
    27 	Jid          string   `xml:"attr"`
    27 	Jid          string   `xml:"jid,attr"`
    28 	Subscription string   `xml:"attr"`
    28 	Subscription string   `xml:"subscription,attr"`
    29 	Name         string   `xml:"attr"`
    29 	Name         string   `xml:"name,attr"`
    30 	Group        []string
    30 	Group        []string `xml:"group"`
    31 }
    31 }
    32 
    32 
    33 type rosterClient struct {
    33 type rosterClient struct {
    34 	rosterChan   <-chan []RosterItem
    34 	rosterChan   <-chan []RosterItem
    35 	rosterUpdate chan<- RosterItem
    35 	rosterUpdate chan<- RosterItem