Exemplo n.º 1
0
 /**
  * Broadcasts a message to all listeners of the channel.
  *
  * @param message
  */
 public void broadcast(Chatter sender, ChatArguments message) {
   ChannelBroadcastEvent event =
       plugin
           .getEngine()
           .getEventManager()
           .callEvent(new ChannelBroadcastEvent(this, sender, message));
   sender = event.getSender();
   message = event.getMessage();
   Placeholders.format(Placeholders.MESSAGE, format, message);
   for (Chatter chatter : listeners) {
     if (sender != null && !chatter.canHear(sender, this)) {
       continue;
     }
     chatter.getParent().sendMessage(format);
   }
   if (bot != null && ircEnabled) {
     bot.sendMessage(message);
   }
   plugin.getChatLogger().log(message);
 }