roster.go
changeset 52 9b664fde0ec3
parent 50 08d2b9deb710
child 54 b345e0473430
equal deleted inserted replaced
51:1af366d10d32 52:9b664fde0ec3
    89 
    89 
    90 // BUG(cjyar) This isn't actually thread safe, though it's unlikely it
    90 // BUG(cjyar) This isn't actually thread safe, though it's unlikely it
    91 // will fail in practice. Either the roster should be protected with a
    91 // will fail in practice. Either the roster should be protected with a
    92 // mutex, or we should make the roster available on a channel instead
    92 // mutex, or we should make the roster available on a channel instead
    93 // of via a method call.
    93 // of via a method call.
       
    94 // BUG(cjyar) RFC 3921, Section 7.4 says we need to reply.
    94 func (cl *Client) maybeUpdateRoster(st Stanza) {
    95 func (cl *Client) maybeUpdateRoster(st Stanza) {
    95 	rq, ok := st.GetNested().(*RosterQuery)
    96 	rq, ok := st.GetNested().(*RosterQuery)
    96 	if st.GetName() == "iq" && st.GetType() == "set" && ok {
    97 	if st.GetName() == "iq" && st.GetType() == "set" && ok {
    97 		for _, item := range(rq.Item) {
    98 		for _, item := range(rq.Item) {
    98 			if item.Subscription == "remove" {
    99 			if item.Subscription == "remove" {