Exemplo n.º 1
0
 @Override
 public void onJoin(
     final String channel, final String sender, final String login, final String hostname) {
   if (channelDao.get(channel).getLogged()) {
     logsDao.logMessage(Logs.Type.JOIN, sender, channel, ":" + hostname + " joined the channel");
   }
 }
Exemplo n.º 2
0
 @Override
 public void onPart(
     final String channel, final String sender, final String login, final String hostname) {
   final Channel chan = channelDao.get(channel);
   if (chan != null && chan.getLogged()) {
     logsDao.logMessage(Logs.Type.PART, sender, channel, "parted the channel");
   }
 }
Exemplo n.º 3
0
 @Override
 public void onQuit(
     final String channel, final String sender, final String login, final String hostname) {
   final Channel chan = channelDao.get(channel);
   if (chan != null && chan.getLogged()) {
     logsDao.logMessage(Logs.Type.QUIT, sender, channel, "quit");
   } else if (chan == null) {
     log.debug("not logging " + channel);
   }
 }
Exemplo n.º 4
0
 @Override
 public void onKick(
     final String channel,
     final String kickerNick,
     final String kickerLogin,
     final String kickerHostname,
     final String recipientNick,
     final String reason) {
   if (channelDao.get(channel).getLogged()) {
     logsDao.logMessage(
         Logs.Type.KICK, kickerNick, channel, " kicked " + recipientNick + " (" + reason + ")");
   }
 }
Exemplo n.º 5
0
 @Override
 public void onAction(
     final String sender,
     final String login,
     final String hostname,
     final String target,
     final String action) {
   if (log.isDebugEnabled()) {
     log.debug("Sender " + sender + " Message " + action);
   }
   if (channelDao.get(target).getLogged()) {
     logsDao.logMessage(Logs.Type.ACTION, sender, target, action);
   }
 }
Exemplo n.º 6
0
 @Override
 public void onInvite(
     final String targetNick,
     final String sourceNick,
     final String sourceLogin,
     final String sourceHostname,
     final String channel) {
   if (log.isDebugEnabled()) {
     log.debug("Invited to " + channel + " by " + sourceNick);
   }
   if (channel.equals(channelDao.get(channel).getName())) {
     joinChannel(channel);
   }
 }
Exemplo n.º 7
0
 private List<Logs> dailyLog(String channelName, DateTime date) {
   Channel channel = channelDao.get(channelName);
   List<Logs> list = null;
   if (channel.getLogged()) {
     DateTime start =
         (date == null ? new DateTime(DateTimeZone.forID("US/Eastern")) : date)
             .withTimeAtStartOfDay();
     DateTime tomorrow = start.plusDays(1);
     LogsCriteria criteria = new LogsCriteria(ds);
     criteria.channel().equal(channelName);
     criteria.and(
         criteria.updated().greaterThanOrEq(start), criteria.updated().lessThanOrEq(tomorrow));
     list = criteria.query().asList();
   }
   return list;
 }