-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API for bans, abstracted to support quiets/exempt #122
Conversation
If you're going to do
You might as well make it configurable:
Also just a global toggle would be nice. |
String getId(); | ||
|
||
@Nonnull | ||
Optional<Integer> getTimeLeft(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not the time left, but the date the ban was set (as best known as by the IRCd. Which might not be very reliable to begin with)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be an Instant
(going off what @Zarthus noted above).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or Duration
if @Zarthus was wrong (you never know 😇)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an unix timestamp, for the curious.
Current coverage is 34.15% (diff: 1.75%)@@ next #122 diff @@
==========================================
Files 135 138 +3
Lines 3301 3408 +107
Methods 0 0
Messages 0 0
Branches 469 490 +21
==========================================
+ Hits 1162 1164 +2
- Misses 2109 2214 +105
Partials 30 30
|
/** | ||
* A list of mode info is available! | ||
*/ | ||
public class ChannelModeInfoListEvent extends ChannelEventBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is for bans, quiets, etc.
There's currently no way, that I can see, to determine which type of list this is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From latest commit - "Needs way of knowing it's a ban"
this.modeInfoLists.get(modeInfo.getMode().getChar()).add(modeInfo); | ||
} else { | ||
Iterator<ModeInfo> iterator = this.modeInfoLists.get(modeInfo.getMode().getChar()).iterator(); | ||
while (iterator.hasNext()){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) {
/** | ||
* Represents a mask that can match a {@link User}. | ||
*/ | ||
public class Mask { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boolean existsIn(List<ModeInfo>)
utility? (or for User
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also maybe a comparator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #130
Sidecomments: Some IRCds support Does KICL currently handle "you're sending too many commands and are being ratelimited", how does it play in on this? |
KICL does not currently handle rate limiting. As for querying modes that way, no it doesn't either. |
Done:
Ban
elementBan
s whenMODE #channel +b
gets a replyTODO: