powered by Jive Software

BUG: vCard does not cache JID when creating new card

I ran into this one last night and while it seems to be a bug, I think it requires further scrutiny. The issue is namely that in VCard::getVCard(), the method takes a parameter of a RosterItemVO. In the case where there is no cached card, a new card is created and populated with some preliminary data, pending the result of the vCard request from the server. The RosterItemVO passed in is used to seed some of the data, but does not seed the JID property of the card, which should theoretically be immutable after the card is created or at least only assigned again under very rare circumstances. My proposal is that when a new VCard is created in VCard::getVCard(), set the JID property of the card.

I can’t think of any case where this would not be desired behavior but that doesn’t mean they don’t exist…

EXISTING:

VCard.as [lines 363-365]

**
**

**363 var vcard:VCard = new VCard();
364 vcard.contact = user;
365 cache[ jidString ] = vcard; **

PROPOSED:

VCard.as [lines 363-366]

**
**

**363 var vcard:VCard = new VCard();
364 vcard.contact = user;
365 cache[ jidString ] = vcard;
**

>>366 vcard.jid = user.jid

Fix available in rev 11561.