Package org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.Item


        changeNick(OCCUPANT1_JID, new EntityImpl(ROOM1_JID, "new nick"));
       
        Occupant occupant = room.findOccupantByJID(OCCUPANT1_JID);
        assertEquals("new nick", occupant.getName());

        Item unavailbleItem = new Item(OCCUPANT1_JID, "new nick", Affiliation.None, Role.Participant);
        assertPresenceStanza(occupant1Queue.getNext(), new EntityImpl(ROOM1_JID, "nick"), OCCUPANT1_JID, "unavailable",
                Arrays.asList(unavailbleItem), Arrays.asList(StatusCode.NEW_NICK, StatusCode.OWN_PRESENCE));
        assertPresenceStanza(occupant2Queue.getNext(), new EntityImpl(ROOM1_JID, "nick"), OCCUPANT2_JID, "unavailable",
                Arrays.asList(unavailbleItem), Arrays.asList(StatusCode.NEW_NICK));

        Item availbleItem = new Item(OCCUPANT1_JID, null, Affiliation.None, Role.Participant);
        assertPresenceStanza(occupant1Queue.getNext(), new EntityImpl(ROOM1_JID, "new nick"), OCCUPANT1_JID, null,
                Arrays.asList(availbleItem), Arrays.asList(StatusCode.OWN_PRESENCE));
        assertPresenceStanza(occupant2Queue.getNext(), new EntityImpl(ROOM1_JID, "new nick"), OCCUPANT2_JID, null,
                Arrays.asList(availbleItem), null);
    }
View Full Code Here


       
        Entity roomAndOccupantNick = new EntityImpl(room.getJID(), existingOccupant.getName());
        StanzaBuilder builder = StanzaBuilder.createPresenceStanza(roomAndOccupantNick, newOccupant.getJid(), null, null, null, null);
       
        builder.addPreparedElement(new X(NamespaceURIs.XEP0045_MUC_USER,
                new Item(null, null, existingOccupant.getAffiliation(), existingOccupant.getRole())));

       
        logger.debug("Room presence from {} sent to {}", newOccupant, roomAndOccupantNick);
        relayStanza(newOccupant.getJid(), builder.build(), serverRuntimeContext);
    }
View Full Code Here

       
        // room is non-anonymous or semi-anonmoys and the occupant a moderator, send full user JID
        boolean includeJid = room.getRoomTypes().contains(RoomType.NonAnonymous) ||
            (room.getRoomTypes().contains(RoomType.SemiAnonymous) && existingOccupant.getRole() == Role.Moderator);
        inner.add(new Item(newOccupant, includeJid, false));
       
        if(existingOccupant.getJid().equals(newOccupant.getJid())) {
           
            if(room.getRoomTypes().contains(RoomType.NonAnonymous)) {
                // notify the user that this is a non-anonymous room
View Full Code Here

                PresenceStanzaType.UNAVAILABLE, null, null);
       
        List<XMLElement> inner = new ArrayList<XMLElement>();
       
        boolean includeJid = includeJidInItem(room, receiver);
        inner.add(new Item(changer, includeJid, true));
        inner.add(new Status(StatusCode.NEW_NICK));
       
        if(receiver.getJid().equals(changer.getJid())) {
            // send status to indicate that this is the users own presence
            inner.add(new Status(StatusCode.OWN_PRESENCE));
View Full Code Here

//        if(receiver.getJid().equals(changer.getJid())) {
//            // send status to indicate that this is the users own presence
//            new Status(StatusCode.OWN_PRESENCE).insertElement(builder);
//        }

        builder.addPreparedElement(new X(NamespaceURIs.XEP0045_MUC_USER, new Item(changer, includeJid, true)));

        logger.debug("Room presence from {} sent to {}", roomAndNick, receiver);
        relayStanza(receiver.getJid(), builder.build(), serverRuntimeContext);
    }
View Full Code Here

       
        StanzaBuilder builder = StanzaBuilder.createPresenceStanza(roomAndOldNick, receiver.getJid(), null, null, null, null);
       
        List<XMLElement> inner = new ArrayList<XMLElement>();
        boolean includeJid = includeJidInItem(room, receiver)
        inner.add(new Item(changer, includeJid, false));
       
        if(receiver.getJid().equals(changer.getJid())) {
            // send status to indicate that this is the users own presence
            inner.add(new Status(StatusCode.OWN_PRESENCE));
        }
View Full Code Here

       
        StanzaBuilder builder = StanzaBuilder.createPresenceStanza(roomAndNewUserNick, existingOccupant.getJid(), null,
                PresenceStanzaType.UNAVAILABLE, null, null);

        List<XMLElement> inner = new ArrayList<XMLElement>();
        inner.add(new Item(null, null, existingOccupant.getAffiliation(), Role.None));
       
        // is this stanza to be sent to the exiting user himself?
        boolean ownStanza = existingOccupant.getJid().equals(exitingOccupant.getJid());
       
        if(ownStanza || statusMessage != null) {
View Full Code Here

        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "nick 2");

        assertNull(changeStatus(OCCUPANT1_JID, ROOM1_JID_WITH_NICK, "xa", "Gone"));
       
        Item item = new Item(OCCUPANT1_JID, "nick", Affiliation.None, Role.Participant);
        assertPresenceStanza(occupant1Queue.getNext(), ROOM1_JID_WITH_NICK, OCCUPANT1_JID, "xa", "Gone",
                item);
        assertPresenceStanza(occupant2Queue.getNext(), ROOM1_JID_WITH_NICK, OCCUPANT2_JID, "xa", "Gone",
                item);
    }
View Full Code Here

        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "nick 2");

        assertNull(changeStatus(OCCUPANT1_JID, ROOM1_JID_WITH_NICK, "xa", null));
       
        Item item = new Item(OCCUPANT1_JID, "nick", Affiliation.None, Role.Participant);
        assertPresenceStanza(occupant1Queue.getNext(), ROOM1_JID_WITH_NICK, OCCUPANT1_JID, "xa", null,
                item);
        assertPresenceStanza(occupant2Queue.getNext(), ROOM1_JID_WITH_NICK, OCCUPANT2_JID, "xa", null,
                item);
    }
View Full Code Here

        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "nick 2");

        assertNull(changeStatus(OCCUPANT1_JID, ROOM1_JID_WITH_NICK, null, "Gone"));
       
        Item item = new Item(OCCUPANT1_JID, "nick", Affiliation.None, Role.Participant);
        assertPresenceStanza(occupant1Queue.getNext(), ROOM1_JID_WITH_NICK, OCCUPANT1_JID, null, "Gone",
                item);
        assertPresenceStanza(occupant2Queue.getNext(), ROOM1_JID_WITH_NICK, OCCUPANT2_JID, null, "Gone",
                item);
    }
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.