Forgot to change the type of RosterItem.Jid to JID.
authorChris Jones <chris@cjones.org>
Sat, 09 Nov 2013 12:37:49 -0700
changeset 181 750bc33ccdda
parent 180 3010996c1928
child 183 b4bd77d58a3e
Forgot to change the type of RosterItem.Jid to JID.
xmpp/roster.go
xmpp/roster_test.go
--- a/xmpp/roster.go	Sat Nov 09 12:33:25 2013 -0700
+++ b/xmpp/roster.go	Sat Nov 09 12:37:49 2013 -0700
@@ -16,7 +16,7 @@
 // See RFC 3921, Section 7.1.
 type RosterItem struct {
 	XMLName      xml.Name `xml:"jabber:iq:roster item"`
-	Jid          string   `xml:"jid,attr"`
+	Jid          JID      `xml:"jid,attr"`
 	Subscription string   `xml:"subscription,attr"`
 	Name         string   `xml:"name,attr"`
 	Group        []string
@@ -34,7 +34,7 @@
 }
 
 func (r *Roster) rosterMgr(upd <-chan Stanza) {
-	roster := make(map[string]RosterItem)
+	roster := make(map[JID]RosterItem)
 	var snapshot []RosterItem
 	var get chan<- []RosterItem
 	for {
--- a/xmpp/roster_test.go	Sat Nov 09 12:33:25 2013 -0700
+++ b/xmpp/roster_test.go	Sat Nov 09 12:37:49 2013 -0700
@@ -49,5 +49,5 @@
 		t.Fatalf("Wrong # items: %v", rq.Item)
 	}
 	item := rq.Item[0]
-	assertEquals(t, "a@b.c", item.Jid)
+	assertEquals(t, "a@b.c", string(item.Jid))
 }