Forgot to change the type of RosterItem.Jid to JID.
--- 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))
}