Search in sources :

Example 1 with IIMMessageHandlerEntry

use of org.eclipse.ecf.presence.bot.IIMMessageHandlerEntry in project ecf by eclipse.

the class IMBot method fireInitBot.

protected void fireInitBot() {
    List commands = bot.getCommands();
    for (int i = 0; i < commands.size(); i++) {
        IIMMessageHandlerEntry entry = (IIMMessageHandlerEntry) commands.get(i);
        entry.getHandler().init(bot);
    }
}
Also used : IIMMessageHandlerEntry(org.eclipse.ecf.presence.bot.IIMMessageHandlerEntry) List(java.util.List)

Example 2 with IIMMessageHandlerEntry

use of org.eclipse.ecf.presence.bot.IIMMessageHandlerEntry in project ecf by eclipse.

the class IMBot method firePreConnect.

protected void firePreConnect() {
    List commands = bot.getCommands();
    for (int i = 0; i < commands.size(); i++) {
        IIMMessageHandlerEntry entry = (IIMMessageHandlerEntry) commands.get(i);
        entry.getHandler().preContainerConnect(container, targetID);
    }
}
Also used : IIMMessageHandlerEntry(org.eclipse.ecf.presence.bot.IIMMessageHandlerEntry) List(java.util.List)

Example 3 with IIMMessageHandlerEntry

use of org.eclipse.ecf.presence.bot.IIMMessageHandlerEntry 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

List (java.util.List)3 IIMMessageHandlerEntry (org.eclipse.ecf.presence.bot.IIMMessageHandlerEntry)3 IChatMessage (org.eclipse.ecf.presence.im.IChatMessage)1 IChatMessageEvent (org.eclipse.ecf.presence.im.IChatMessageEvent)1