powered by Jive Software

BUG- Roster.as EscapedJID passed to addRosterItem

Description:

In the Roster class, when handling roster events via RosterExtension, of SUBSCRIBE_TYPE_REMOVE and SUBSCRIBE_TYPE_NONE, the incorrect type of JID is being passed to addRosterItem. An EscapedJID is being passed. addRosterItem is expecting an UnescapedJIDWhen these types are processed, an exception is thrown.

See Roster.as

Expected:

line 489 should be:

addRosterItem( new UnescapedJID(item.jid), item.name, RosterExtension.SHOW_UNAVAILABLE, “Offline”, groups, item.subscription.toLowerCase(), item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE );

line 494 should be:

addRosterItem( new UnescapedJID(item.jid), item.name, RosterExtension.SHOW_PENDING, “Pending”, groups, item.subscription.toLowerCase(), item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE );

Actual:

line 489:

addRosterItem( item.jid, item.name, RosterExtension.SHOW_UNAVAILABLE, “Offline”, groups, item.subscription.toLowerCase(), item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE );

line 494:

addRosterItem( item.jid, item.name, RosterExtension.SHOW_PENDING, “Pending”, groups, item.subscription.toLowerCase(), item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE );

UPDATE: a similar type mismatch occurs on lines 461 and 473
Roster.as (24892 Bytes)

Thanks for posting this. I’m going to add it to the issue tracker.