Search in sources :

Example 6 with IChatMessageEvent

use of org.eclipse.ecf.presence.im.IChatMessageEvent in project ecf by eclipse.

the class IMBot method handleMessageEvent.

public void handleMessageEvent(IIMMessageEvent event) {
    if (event instanceof IChatMessageEvent) {
        IChatMessageEvent imEvent = (IChatMessageEvent) event;
        IChatMessage message = imEvent.getChatMessage();
        List commands = bot.getCommands();
        for (int i = 0; i < commands.size(); i++) {
            IIMMessageHandlerEntry entry = (IIMMessageHandlerEntry) commands.get(i);
            entry.handleIMMessage(message);
        }
    }
}
Also used : IChatMessage(org.eclipse.ecf.presence.im.IChatMessage) IIMMessageHandlerEntry(org.eclipse.ecf.presence.bot.IIMMessageHandlerEntry) IChatMessageEvent(org.eclipse.ecf.presence.im.IChatMessageEvent) List(java.util.List)

Aggregations

IChatMessageEvent (org.eclipse.ecf.presence.im.IChatMessageEvent)6 IIMMessageEvent (org.eclipse.ecf.presence.IIMMessageEvent)5 IIMMessageListener (org.eclipse.ecf.presence.IIMMessageListener)5 IChatMessage (org.eclipse.ecf.presence.im.IChatMessage)4 IContainerListener (org.eclipse.ecf.core.IContainerListener)2 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 List (java.util.List)1 Properties (java.util.Properties)1 IContainerConnectedEvent (org.eclipse.ecf.core.events.IContainerConnectedEvent)1 IContainerEvent (org.eclipse.ecf.core.events.IContainerEvent)1 ID (org.eclipse.ecf.core.identity.ID)1 IDCreateException (org.eclipse.ecf.core.identity.IDCreateException)1 ECFException (org.eclipse.ecf.core.util.ECFException)1 IPresenceContainerAdapter (org.eclipse.ecf.presence.IPresenceContainerAdapter)1 IIMMessageHandlerEntry (org.eclipse.ecf.presence.bot.IIMMessageHandlerEntry)1 IChatRoomContainer (org.eclipse.ecf.presence.chatroom.IChatRoomContainer)1 IChatManager (org.eclipse.ecf.presence.im.IChatManager)1