# HG changeset patch # User Chris Jones # Date 1378179924 25200 # Node ID 34e917ca6a113d8a44b153e778eabf1be095f5c9 # Parent 42a9995faa38c7aeafef6c14d72cbb3feb186288 Updated the example to match the new API, and fixed the roster Update to not require a reference to the client. diff -r 42a9995faa38 -r 34e917ca6a11 examples/interact.go --- a/examples/interact.go Mon Sep 02 20:38:57 2013 -0700 +++ b/examples/interact.go Mon Sep 02 20:45:24 2013 -0700 @@ -53,11 +53,12 @@ } defer close(c.Out) - err = c.StartSession(true, &xmpp.Presence{}) + err = c.StartSession(&xmpp.Presence{}) if err != nil { log.Fatalf("StartSession: %v", err) } - roster := xmpp.Roster(c) + c.Roster.Update() + roster := c.Roster.Get() fmt.Printf("%d roster entries:\n", len(roster)) for i, entry := range roster { fmt.Printf("%d: %v\n", i, entry) diff -r 42a9995faa38 -r 34e917ca6a11 roster.go --- a/roster.go Mon Sep 02 20:38:57 2013 -0700 +++ b/roster.go Mon Sep 02 20:45:24 2013 -0700 @@ -138,9 +138,9 @@ // Synchronously fetch this entity's roster from the server and cache // that information. The client can access the roster by watching for // RosterQuery objects or by calling Get(). -func (r *Roster) Update(client *Client) { - iq := &Iq{Header: Header{From: client.Jid.String(), Type: "get", - Id: NextId(), Nested: []interface{}{RosterQuery{}}}} +func (r *Roster) Update() { + iq := &Iq{Header: Header{Type: "get", Id: NextId(), + Nested: []interface{}{RosterQuery{}}}} waitchan := make(chan int) done := func() { close(waitchan)