Esempio n. 1
0
 /**
  * Get all users that don't have any special status in this channel. This means that they aren't
  * ops, have voice, superops, halops, or owners in this channel
  *
  * @return An <i>unmodifiable</i> Set (IE snapshot) of non-special users in the channel
  */
 public Set<User> getNormalUsers() {
   // Build set
   Set<User> normalUsers = new HashSet<User>(bot.getUsers(this));
   normalUsers.removeAll(ops);
   normalUsers.removeAll(voices);
   normalUsers.removeAll(halfOps);
   normalUsers.removeAll(superOps);
   normalUsers.removeAll(owners);
   return Collections.unmodifiableSet(normalUsers);
 }
Esempio n. 2
0
 /**
  * Gets the channel mode. If mode is simple (no arguments), this will return immediately. If its
  * not (mode with arguments, eg channel key), then asks the server for the correct mode, waiting
  * until it gets a response
  *
  * <p><b>WARNING:</b> Because of the last checking, a threaded listener manager like {@link
  * ThreadedListenerManager} is required. Using a single threaded listener manager like {@link
  * GenericListenerManager} will mean this method <i>never returns</i>!
  *
  * @return A known good mode, either immediatly or soon.
  */
 public String getMode() {
   if (!modeStale) return mode;
   // Mode is stale, get new mode from server
   try {
     bot.sendRawLine("MODE " + getName());
     if (modeLatch == null || modeLatch.getCount() == 0) modeLatch = new CountDownLatch(1);
     // Wait for setMode to be called
     modeLatch.await();
     // Mode is no longer stale since we have a good mode
     modeStale = false;
     // We have known good mode from server, now return
     return mode;
   } catch (InterruptedException e) {
     // bot.logException(e);
     throw new RuntimeException("Waiting for mode response interrupted", e);
   }
 }
Esempio n. 3
0
 /**
  * Get all users in this channel. Simply calls {@link HeufyBot#getUsers(org.pircbotx.Channel) }
  *
  * @return An <i>Unmodifiable</i> Set of users in this channel
  */
 public Set<User> getUsers() {
   return bot.getUsers(this);
 }