Package rocks.xmpp.extensions.muc.conference.model

Examples of rocks.xmpp.extensions.muc.conference.model.DirectInvitation


     */
    public void invite(Jid invitee, String reason, boolean direct) {
        Message message;
        if (direct) {
            message = new Message(invitee, Message.Type.NORMAL);
            message.getExtensions().add(new DirectInvitation(roomJid, null, reason));
        } else {
            message = new Message(roomJid, Message.Type.NORMAL);
            message.getExtensions().add(MucUser.withInvites(new Invite(invitee, reason)));
        }
        xmppSession.send(message);
View Full Code Here


                        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) {
                            notifyListeners(new InvitationEvent(MultiUserChatManager.this, xmppSession, message.getFrom(), directInvitation.getRoomAddress(), directInvitation.getReason(), directInvitation.getPassword(), directInvitation.isContinue(), directInvitation.getThread(), false));
                        }
                    }
                }
            }
        });
View Full Code Here

                "     reason='Hey Hecate, this is the place for all good witches!'\n" +
                "     thread='e0ffe42b28561960c6b12b944a092794b9683a38'/>\n" +
                "</message>";

        Message message = unmarshal(xml, Message.class);
        DirectInvitation directInvitation = message.getExtension(DirectInvitation.class);
        Assert.assertNotNull(directInvitation);
        Assert.assertTrue(directInvitation.isContinue());
        Assert.assertEquals(directInvitation.getRoomAddress(), Jid.valueOf("darkcave@macbeth.shakespeare.lit"));
        Assert.assertEquals(directInvitation.getPassword(), "cauldronburn");
        Assert.assertEquals(directInvitation.getReason(), "Hey Hecate, this is the place for all good witches!");
        Assert.assertEquals(directInvitation.getThread(), "e0ffe42b28561960c6b12b944a092794b9683a38");
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.muc.conference.model.DirectInvitation

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.