equal
deleted
inserted
replaced
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) |