roster.go
changeset 124 34e917ca6a11
parent 121 ebb86cbdd218
equal deleted inserted replaced
123:42a9995faa38 124:34e917ca6a11
   136 }
   136 }
   137 
   137 
   138 // Synchronously fetch this entity's roster from the server and cache
   138 // Synchronously fetch this entity's roster from the server and cache
   139 // that information. The client can access the roster by watching for
   139 // that information. The client can access the roster by watching for
   140 // RosterQuery objects or by calling Get().
   140 // RosterQuery objects or by calling Get().
   141 func (r *Roster) Update(client *Client) {
   141 func (r *Roster) Update() {
   142 	iq := &Iq{Header: Header{From: client.Jid.String(), Type: "get",
   142 	iq := &Iq{Header: Header{Type: "get", Id: NextId(),
   143 		Id: NextId(), Nested: []interface{}{RosterQuery{}}}}
   143 		Nested: []interface{}{RosterQuery{}}}}
   144 	waitchan := make(chan int)
   144 	waitchan := make(chan int)
   145 	done := func() {
   145 	done := func() {
   146 		close(waitchan)
   146 		close(waitchan)
   147 	}
   147 	}
   148 	r.waitFor(iq.Id, done)
   148 	r.waitFor(iq.Id, done)