Package rocks.xmpp.extensions.delay.model

Examples of rocks.xmpp.extensions.delay.model.DelayedDelivery


                "     stamp='2002-09-10T23:08:25Z'>Offline Storage</delay>\n" +
                "</message>\n";

        Message message = unmarshal(xml, Message.class);
        Assert.assertEquals(message.getExtensions().size(), 1);
        DelayedDelivery delay = message.getExtension(DelayedDelivery.class);
        Assert.assertNotNull(delay);
        Assert.assertEquals(delay.getFrom(), new Jid("capulet.com"));
        Assert.assertEquals(delay.getTimeStamp(), DatatypeConverter.parseDate("2002-09-10T23:08:25Z").getTime());
        Assert.assertEquals(delay.getReason(), "Offline Storage");
    }
View Full Code Here


                    if (message.getFrom().asBareJid().equals(roomJid)) {
                        if (message.getType() == AbstractMessage.Type.GROUPCHAT) {
                            // This is a <message/> stanza from the room JID (or from the occupant JID of the entity that set the subject), with a <subject/> element but no <body/> element
                            if (message.getSubject() != null && message.getBody() == null) {
                                Date date;
                                DelayedDelivery delayedDelivery = message.getExtension(DelayedDelivery.class);
                                if (delayedDelivery != null) {
                                    date = delayedDelivery.getTimeStamp();
                                } else {
                                    date = new Date();
                                }
                                notifySubjectChangeListeners(new SubjectChangeEvent(ChatRoom.this, message.getSubject(), message.getFrom().getResource(), delayedDelivery != null, date));
                            } else {
View Full Code Here

     */
    public void forwardMessage(Message message, Jid to) {
        Message outerMessage = new Message(to, message.getType());
        // Include a empty body to make sure it will be stored in offline case.
        outerMessage.setBody(" ");
        outerMessage.getExtensions().add(new Forwarded(message, new DelayedDelivery(new Date())));
        xmppSession.send(outerMessage);
    }
View Full Code Here

                            xmppSession.send(receiptMessage);
                        }
                        // If the message is a receipt.
                        Received received = message.getExtension(Received.class);
                        if (received != null) {
                            DelayedDelivery delayedDelivery = message.getExtension(DelayedDelivery.class);
                            Date deliveryDate;
                            if (delayedDelivery != null) {
                                deliveryDate = delayedDelivery.getTimeStamp();
                            } else {
                                deliveryDate = new Date();
                            }

                            // Notify the listeners about the reception.
View Full Code Here

                    ContactExchange contactExchange = message.getExtension(ContactExchange.class);
                    if (contactExchange != null) {
                        List<ContactExchange.Item> items = getItemsToProcess(contactExchange.getItems());
                        if (!items.isEmpty()) {
                            Date date;
                            DelayedDelivery delayedDelivery = message.getExtension(DelayedDelivery.class);
                            if (delayedDelivery != null) {
                                date = delayedDelivery.getTimeStamp();
                            } else {
                                date = new Date();
                            }
                            processItems(items, message.getFrom(), message.getBody(), date);
                        }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.delay.model.DelayedDelivery

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.