raisedragon / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

User.hasOp() and User.hasVoice() options #130

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What is the purpose?
- To check if the current sender in an Event has Op/Voice status in the current 
Channel they are in.

What is the expected output?
if (user.hasOp() || user.hasVoice()) {
    return true;
}
return false;
(easiest way to explain it)

What version of the product are you using? On what operating system?
PircBotX 1.9 on Windows 7 Home Premium x64 with Java 7 u21 (x86 and x64)

Please provide any additional information below.
Right now you can have it tell you what channels the user has Op/Voice in, but 
to check the current channel requires me to write a separate method to  check 
the current channel from a MessageEvent against the channels a user has 
Voice/Op in.

if(user.getChannelsVoiceIn().contains(channel)) {
 return true;
}
return false;

Original issue reported on code.google.com by kyle10...@gmail.com on 29 May 2013 at 4:33

GoogleCodeExporter commented 9 years ago
EDIT: Nevermind ... I didn't realize the Channel could check for 
Ops/Voice/etc... Whoops.

(Sorry, new to PircBotX - coming from the old PircBot 1.5)

Original comment by kyle10...@gmail.com on 29 May 2013 at 4:40

GoogleCodeExporter commented 9 years ago
Yes there are several methods in channel that essentially do what your code 
does, just a little bit faster since it doesn't create a temporary Set. They 
are not in User to reduce method bloat, since most of the time you want to 
manage users at the channel level

Original comment by Lord.Qua...@gmail.com on 30 May 2013 at 1:36