Skip to content
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

Merged
merged 1 commit into from
Aug 9, 2016
Merged

API for bans, abstracted to support quiets/exempt #122

merged 1 commit into from
Aug 9, 2016

Conversation

mbax
Copy link
Member

@mbax mbax commented Jul 6, 2016

Done:

  • Create Ban element
  • Create a list of Bans when MODE #channel +b gets a reply

TODO:

  • Track bans for channels the client is in
  • Convenience method for removing a ban
  • Event for ban list being updated (e.g. shortly after channel join)
  • Maybe toggle tracking of bans per channel.

@Zarthus
Copy link
Member

Zarthus commented Jul 6, 2016

If you're going to do

Maybe toggle tracking of bans per channel

You might as well make it configurable:

Char[] modesToTrack = { 'b', 'q', 'I', 'e' }
                                // ^    ^ only gettable by ops i think
                                // may be configurable on some ircds

Also just a global toggle would be nice.

String getId();

@Nonnull
Optional<Integer> getTimeLeft();
Copy link
Member

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)

Copy link
Member

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).

Copy link

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 😇)

Copy link
Member

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.

@codecov-io
Copy link

codecov-io commented Jul 8, 2016

Current coverage is 34.15% (diff: 1.75%)

Merging #122 into next will decrease coverage by 1.04%

@@               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          

Powered by Codecov. Last update 46cdf11...4060da5

/**
* A list of mode info is available!
*/
public class ChannelModeInfoListEvent extends ChannelEventBase {
Copy link
Member

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.

Copy link
Member Author

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"

@mbax mbax added this to the 2.1.0 milestone Jul 9, 2016
@mbax mbax modified the milestones: 2.1.0, 2.2.0 Jul 11, 2016
@mbax mbax changed the title API for bans API for bans, quiets, and more Jul 22, 2016
@mbax mbax changed the title API for bans, quiets, and more API for bans, abstracted to support quiets/exempt Aug 3, 2016
this.modeInfoLists.get(modeInfo.getMode().getChar()).add(modeInfo);
} else {
Iterator<ModeInfo> iterator = this.modeInfoLists.get(modeInfo.getMode().getChar()).iterator();
while (iterator.hasNext()){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

) {

@mbax mbax merged commit 4060da5 into next Aug 9, 2016
/**
* Represents a mask that can match a {@link User}.
*/
public class Mask {
Copy link
Member

@Zarthus Zarthus Aug 9, 2016

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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also maybe a comparator?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #130

@Zarthus
Copy link
Member

Zarthus commented Aug 9, 2016

Sidecomments:

Some IRCds support /mode #channel bqIe, does KICL support that? (I have no idea where this feature is documented, or how to detect it) -- sounds like a neat optimization.

Does KICL currently handle "you're sending too many commands and are being ratelimited", how does it play in on this?

@mbax
Copy link
Member Author

mbax commented Aug 9, 2016

KICL does not currently handle rate limiting. As for querying modes that way, no it doesn't either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants