eusoulevi / emite

Automatically exported from code.google.com/p/emite
0 stars 0 forks source link

Some room presence with several "x" childs are not processed (maybe also DelPacket.getChildren bug) #56

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Some test like:
(...)
        emite.receives("<presence to='user@domain/resource'
from='room1@domain/otherUser2'>"
                + "<priority>0</priority><x xmlns='vcard-temp:x:update'>"
                + "<photo>af70fe6519d6a27a910c427c3bc551dcd36073e7</photo></x>"
                + "<x xmlns='http://jabber.org/protocol/muc#user'>"
                + "<item jid='otheruserjid@domain/otherresoruce'
affiliation='none' "
                + "role='participant'/></x></presence>");
        assertEquals(1, room.getOccupantsCount());
        Occupant user = room.findOccupant(uri("room1@domain/otherUser2"));
        assertNotNull(user1);
        assertEquals(Affiliation.none, user.getAffiliation());
        assertEquals(Role.participant, user.getRole());
 (...)

fails. Any gmail account with photo avatar will fail (I think).

Trying to fix it (only testing in local without touch the svn repo), I see
that maybe getChildren is not working well:
    /**
     * @see http://www.xmpp.org/extensions/xep-0045.html#createroom
     */
    private void eventPresence(final Presence presence) {
(...)
                List<? extends IPacket> xtensions = presence.getChildren("x"); 
// ****** xtensions is always empty ******
                for (Iterator iterator = xtensions.iterator();
iterator.hasNext();) {
                    IPacket xtension = (IPacket) iterator.next();
                   if (xtension.hasAttribute("xmlns",
"http://jabber.org/protocol/muc#user")) {

(...)

Original issue reported on code.google.com by vruiz.ju...@gmail.com on 7 May 2008 at 1:39

GoogleCodeExporter commented 9 years ago

Original comment by vruiz.ju...@gmail.com on 15 May 2008 at 2:51

GoogleCodeExporter commented 9 years ago
Fixed

Original comment by vruiz.ju...@gmail.com on 16 May 2008 at 9:37