Esempio n. 1
0
 @Override
 public void onPart(PartEvent event) {
   String relay =
       String.format(
           "[IRMC] %s has left %s: %s",
           event.getUser().getNick(), event.getChannel().getName(), event.getReason());
   plugin.relayToServer(relay);
 }
Esempio n. 2
0
 @java.lang.Override
 @java.lang.SuppressWarnings("all")
 public boolean equals(final java.lang.Object o) {
   if (o == this) return true;
   if (!(o instanceof PartEvent)) return false;
   final PartEvent<?> other = (PartEvent<?>) o;
   if (!other.canEqual((java.lang.Object) this)) return false;
   if (!super.equals(o)) return false;
   final java.lang.Object this$channel = this.getChannel();
   final java.lang.Object other$channel = other.getChannel();
   if (this$channel == null ? other$channel != null : !this$channel.equals(other$channel))
     return false;
   final java.lang.Object this$user = this.getUser();
   final java.lang.Object other$user = other.getUser();
   if (this$user == null ? other$user != null : !this$user.equals(other$user)) return false;
   final java.lang.Object this$reason = this.getReason();
   final java.lang.Object other$reason = other.getReason();
   if (this$reason == null ? other$reason != null : !this$reason.equals(other$reason))
     return false;
   return true;
 }
Esempio n. 3
0
 public PartEvent(org.pircbotx.hooks.events.PartEvent event) {
   sender = event.getUser().getNick();
   hostname = event.getUser().getHostmask();
   channel = event.getChannel().getName();
 }
Esempio n. 4
0
 @Override
 public void onPart(PartEvent event) {
   if (Bot.relay.containsKey(event.getChannel().getName().toLowerCase())) {
     if (event.getReason().isEmpty()) {
       event
           .getBot()
           .sendMessage(
               Bot.relay.get(event.getChannel().getName().toLowerCase()),
               String.format(
                   "[%s] %s (%s) has left %s (no reason)",
                   event.getChannel().getName(),
                   event.getUser().getNick(),
                   event.getUser().getLogin() + "@" + event.getUser().getHostmask(),
                   event.getChannel().getName()));
     } else {
       event
           .getBot()
           .sendMessage(
               Bot.relay.get(event.getChannel().getName().toLowerCase()),
               String.format(
                   "[%s] %s (%s) has left %s :%s",
                   event.getChannel().getName(),
                   event.getUser().getNick(),
                   event.getUser().getLogin() + "@" + event.getUser().getHostmask(),
                   event.getChannel().getName(),
                   event.getReason()));
     }
   }
   if (Config.LOGGED_CHANS.contains(event.getChannel().getName())) {
     if (event.getReason().isEmpty()) {
       log(
           event.getChannel().getName(),
           String.format(
               "%s %s (%s) has left %s (no reason)",
               Utils.getTime(),
               event.getUser().getNick(),
               event.getUser().getLogin() + "@" + event.getUser().getHostmask(),
               event.getChannel().getName()));
     } else {
       log(
           event.getChannel().getName(),
           String.format(
               "%s %s (%s) has left %s :%s",
               Utils.getTime(),
               event.getUser().getNick(),
               event.getUser().getLogin() + "@" + event.getUser().getHostmask(),
               event.getChannel().getName(),
               event.getReason()));
     }
     synchronized (Utils.userNickServMap) {
       if (Utils.userNickServMap.containsKey(event.getUser().getNick())) {
         Utils.userNickServMap.remove(event.getUser().getNick());
       }
     }
   }
 }