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));
}
}
}