Search in sources :

Example 6 with MessageEvent

use of org.jivesoftware.smackx.xevent.packet.MessageEvent in project Smack by igniterealtime.

the class MessageEventManager method addNotificationsRequests.

/**
     * Adds event notification requests to a message. For each event type that
     * the user wishes event notifications from the message recepient for, <tt>true</tt>
     * should be passed in to this method.
     * 
     * @param message the message to add the requested notifications.
     * @param offline specifies if the offline event is requested.
     * @param delivered specifies if the delivered event is requested.
     * @param displayed specifies if the displayed event is requested.
     * @param composing specifies if the composing event is requested.
     */
public static void addNotificationsRequests(Message message, boolean offline, boolean delivered, boolean displayed, boolean composing) {
    // Create a MessageEvent Package and add it to the message
    MessageEvent messageEvent = new MessageEvent();
    messageEvent.setOffline(offline);
    messageEvent.setDelivered(delivered);
    messageEvent.setDisplayed(displayed);
    messageEvent.setComposing(composing);
    message.addExtension(messageEvent);
}
Also used : MessageEvent(org.jivesoftware.smackx.xevent.packet.MessageEvent)

Aggregations

MessageEvent (org.jivesoftware.smackx.xevent.packet.MessageEvent)6 Message (org.jivesoftware.smack.packet.Message)4