Examples of MucUser


Examples of rocks.xmpp.extensions.muc.model.user.MucUser

        Assert.assertEquals(mucUser.getDestroy().getReason(), "Macbeth doth come.");
    }

    @Test
    public void marshalDestroyRoom() throws JAXBException, XMLStreamException {
        MucUser mucUser = MucUser.withDestroy(Affiliation.NONE, Role.NONE, Jid.valueOf("coven@chat.shakespeare.lit"), "Macbeth doth come.");
        String xml = marshal(mucUser);
        Assert.assertEquals(mucUser.getDestroy().getReason(), "Macbeth doth come.");
        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><item affiliation=\"none\" role=\"none\"></item><destroy jid=\"coven@chat.shakespeare.lit\"><reason>Macbeth doth come.</reason></destroy></x>");
    }
View Full Code Here

Examples of rocks.xmpp.extensions.muc.model.user.MucUser

        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><item affiliation=\"none\" role=\"none\"></item><destroy jid=\"coven@chat.shakespeare.lit\"><reason>Macbeth doth come.</reason></destroy></x>");
    }

    @Test
    public void marshalWithItem() throws JAXBException, XMLStreamException {
        MucUser mucUser = MucUser.withItem(Affiliation.NONE, Role.NONE, Jid.valueOf("coven@chat.shakespeare.lit"), "Nick");
        String xml = marshal(mucUser);
        Assert.assertEquals(mucUser.getItem().getNick(), "Nick");
        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><item affiliation=\"none\" jid=\"coven@chat.shakespeare.lit\" nick=\"Nick\" role=\"none\"></item></x>");
    }
View Full Code Here

Examples of rocks.xmpp.extensions.muc.model.user.MucUser

        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><item affiliation=\"none\" jid=\"coven@chat.shakespeare.lit\" nick=\"Nick\" role=\"none\"></item></x>");
    }

    @Test
    public void marshalWithInvites() throws JAXBException, XMLStreamException {
        MucUser mucUser = MucUser.withInvites(new Invite(Jid.valueOf("coven@chat.shakespeare.lit"), "reason"));
        String xml = marshal(mucUser);
        Assert.assertEquals(mucUser.getInvites().size(), 1);
        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><invite to=\"coven@chat.shakespeare.lit\"><reason>reason</reason></invite></x>");
    }
View Full Code Here

Examples of rocks.xmpp.extensions.muc.model.user.MucUser

        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><invite to=\"coven@chat.shakespeare.lit\"><reason>reason</reason></invite></x>");
    }

    @Test
    public void marshalWithStatus() throws JAXBException, XMLStreamException {
        MucUser mucUser = MucUser.withStatus(Status.affiliationChanged());
        String xml = marshal(mucUser);
        Assert.assertEquals(mucUser.getStatusCodes().size(), 1);
        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><status code=\"101\"></status></x>");
    }
View Full Code Here

Examples of rocks.xmpp.extensions.muc.model.user.MucUser

        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><status code=\"101\"></status></x>");
    }

    @Test
    public void marshalWithDecline() throws JAXBException, XMLStreamException {
        MucUser mucUser = MucUser.withDecline(Jid.valueOf("coven@chat.shakespeare.lit"), "reason");
        String xml = marshal(mucUser);
        Assert.assertEquals(mucUser.getDecline().getReason(), "reason");
        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><decline to=\"coven@chat.shakespeare.lit\"><reason>reason</reason></decline></x>");
    }
View Full Code Here

Examples of rocks.xmpp.extensions.muc.model.user.MucUser

            @Override
            public void handle(MessageEvent e) {
                if (e.isIncoming()) {
                    Message message = e.getMessage();
                    // Check, if the message contains a mediated invitation.
                    MucUser mucUser = message.getExtension(MucUser.class);
                    if (mucUser != null) {
                        for (Invite invite : mucUser.getInvites()) {
                            notifyListeners(new InvitationEvent(MultiUserChatManager.this, xmppSession, invite.getFrom(), message.getFrom(), invite.getReason(), mucUser.getPassword(), invite.isContinue(), invite.getThread(), true));
                        }
                    } else {
                        // Check, if the message contains a direct invitation.
                        DirectInvitation directInvitation = message.getExtension(DirectInvitation.class);
                        if (directInvitation != null) {
View Full Code Here

Examples of rocks.xmpp.extensions.muc.model.user.MucUser

                            }
                        }

                        if (avatarUpdate != null && avatarUpdate.getHash() != null) {
                            final Jid contact;
                            MucUser mucUser = presence.getExtension(MucUser.class);
                            if (mucUser != null) {
                                if (mucUser.getItem() != null && mucUser.getItem().getJid() != null) {
                                    contact = mucUser.getItem().getJid().asBareJid();
                                } else {
                                    // Ignore presence received from anonymous MUC room.
                                    return;
                                }
                            } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.