Search in sources :

Example 1 with MessageEvent

use of org.eclipse.ecf.internal.provider.xmpp.events.MessageEvent in project ecf by eclipse.

the class XMPPContainer method handleAsExtension.

protected boolean handleAsExtension(Packet packet) {
    final Iterator i = packet.getExtensions().iterator();
    for (; i.hasNext(); ) {
        final Object extension = i.next();
        if (extension instanceof XHTMLExtension) {
            final XHTMLExtension xhtmlExtension = (XHTMLExtension) extension;
            deliverEvent(new MessageEvent((Message) packet, xhtmlExtension.getBodies()));
            return true;
        }
        if (packet instanceof Presence && extension instanceof MUCUser) {
            return true;
        }
    }
    return false;
}
Also used : MUCUser(org.jivesoftware.smackx.packet.MUCUser) ContainerMessage(org.eclipse.ecf.provider.generic.ContainerMessage) Message(org.jivesoftware.smack.packet.Message) MessageEvent(org.eclipse.ecf.internal.provider.xmpp.events.MessageEvent) Iterator(java.util.Iterator) Presence(org.jivesoftware.smack.packet.Presence) XHTMLExtension(org.jivesoftware.smackx.packet.XHTMLExtension)

Aggregations

Iterator (java.util.Iterator)1 MessageEvent (org.eclipse.ecf.internal.provider.xmpp.events.MessageEvent)1 ContainerMessage (org.eclipse.ecf.provider.generic.ContainerMessage)1 Message (org.jivesoftware.smack.packet.Message)1 Presence (org.jivesoftware.smack.packet.Presence)1 MUCUser (org.jivesoftware.smackx.packet.MUCUser)1 XHTMLExtension (org.jivesoftware.smackx.packet.XHTMLExtension)1