Package com.brewtab.irclog

Examples of com.brewtab.irclog.IRCLogEvent


        return stmt;
    }

    private void last(Channel channel, String nick) {
        IRCLogEvent event = logger.queryMessage(lastMessageStmt(channel.getName(), nick));

        if (event == null) {
            logger.queryEvent(lastEventStmt(channel.getName(), nick));
        }

        if (event == null) {
            channel.write(String.format("Never seen %s", nick));
        } else {
            String formattedDate = dateFormat.format(event.getDate());

            if (event.getEventType() == IRCLogEvent.JOIN_EVENT) {
                channel.write(String.format("%s joined at %s", nick, formattedDate));
            } else if (event.getEventType() == IRCLogEvent.PART_EVENT) {
                channel.write(String.format("%s parted at %s", nick, formattedDate));
            } else if (event.getEventType() == IRCLogEvent.QUIT_EVENT) {
                channel.write(String.format("%s quit at %s", nick, formattedDate));
            } else if (event.getEventType() == IRCLogEvent.MESSAGE_EVENT) {
                channel.write(String.format("%s said \"%s\" at %s", nick, event.getData(), formattedDate));
            }
        }
    }
View Full Code Here


        int count = tsQueryCount(channel.getName(), query);

        if (count == 0) {
            channel.write("No messages found");
        } else {
            IRCLogEvent msg = tsQueryLast(channel.getName(), query);

            channel.writeMultiple(
                String.format("%d %s found. Most recent on %s.", count, count > 1 ? "results" : "result", dateFormat.format(msg.getDate())),
                String.format("<%s> %s", msg.getNick(), msg.getData())
                );
        }
    }
View Full Code Here

TOP

Related Classes of com.brewtab.irclog.IRCLogEvent

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.