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

Properly report channel bans in .bans #1525

Merged
merged 1 commit into from
Jan 20, 2024
Merged

Properly report channel bans in .bans #1525

merged 1 commit into from
Jan 20, 2024

Conversation

vanosg
Copy link
Member

@vanosg vanosg commented Jan 14, 2024

Found by: @wilkowy
Patch by: Geo
Fixes: #1297

One-line summary:
Properly report channel bans with .bans

Additional description (if needed):
Prior to this patch, .bans was inconsistent in reporting as the help described.... it was inconsistent enough where I struggle to even capture what didn't work. The two major points were running .bans with a console of '*' only reported channels bans of the first channel in the channel record, and .bans #channel didn't report the bans on the requested channel.

Test cases demonstrating functionality (if applicable):

For these examples, #eggdroptest has no active bans that are in the global banlist but does have active bans that are in the channel banlist. #eggtest has one active bans that is in the global banlist, and one active bans in the channel banlist.

Specific test cases below are:

show active global and channel bans for the console channel

.console #eggdroptest
[03:55:55] #-HQ# console #eggdroptest
Set your console to #eggdroptest: mkcobxs (msgs, kicks/modes, cmds, misc, bots, files, server input).
.bans 
[03:55:57] #-HQ# bans 
Global bans:
Channel bans for #eggdroptest:  (* = not placed by bot)
* [  9] *!*@217-115-40-234.cust.bredband2.com (Eggdrop!beer@eggdrop/bot) (active 12:13)
* [ 10] *!*@flow.users.undernet.org (Eggdrop!beer@eggdrop/bot) (active 12:13)
* [ 11] Eggybot!*@* (Eggdrop!beer@eggdrop/bot) (active 12:13)
Use '.bans all' to see the total list.

show active global and channel bans for a channel that is not the console channel

.bans #eggtest
[03:56:02] #-HQ# bans #eggtest
Global bans:
  [  5] *!*@soo.com (perm)
        -HQ: $-1y
        Created 1905 days ago
Channel bans for #eggtest:  (* = not placed by bot)
  [  8] *!*@aol.com (perm)
        -HQ: requested
        Created 23:14
* [  9] *!*@eggtest.com (Geo!~scase@user/geo) (active 11:54)
Use '.bans all' to see the total list.

show all global bans stored on the bot (active and inactive), and all channel bans for the console channel stored on the bot

.bans all
[03:56:12] #-HQ# bans all
Global bans:   (! = not active on #eggdroptest)
! [  1] *!*@qwer.com (perm)
        -HQ: requested
        Created 21:35
! [  2] [email protected]* (perm)
        -HQ: requested
        Created 1405 days ago
! [  3] *!*@423456789.523456789.62* (perm) (sticky)
        -HQ: requested
        Created 1405 days ago
! [  4] *!*@asdfasdf.com (perm)
        -HQ: requested
        Created 1405 days ago
Channel bans for #eggdroptest:   (! = not active, * = not placed by bot)
! [  5] *!*@asf.com (perm)
        -HQ: requested
        Created 21:35
* [  6] *!*@217-115-40-234.cust.bredband2.com (Eggdrop!beer@eggdrop/bot) (active 12:27)
* [  7] *!*@flow.users.undernet.org (Eggdrop!beer@eggdrop/bot) (active 12:27)
* [  8] Eggybot!*@* (Eggdrop!beer@eggdrop/bot) (active 12:27)

match a mask for the console channel

.bans aol
[04:08:10] #-HQ# bans aol
Global bans:
Channel bans for #eggtest:  (* = not placed by bot)
.bans *aol*
[04:08:16] #-HQ# bans *aol*
Global bans:
Channel bans for #eggtest:  (* = not placed by bot)
  [  8] *!*@aol.com (perm)
        -HQ: requested
        Created 23:14

with a console set to *, use .bans show all active global and channel bans for all channels

.console *
[03:58:40] #-HQ# console *
Set your console to *: mkcobxs (msgs, kicks/modes, cmds, misc, bots, files, server input).
.bans
[03:58:42] #-HQ# bans 
Global bans:
Channel bans for #eggdroptest:  (* = not placed by bot)
* [  9] *!*@217-115-40-234.cust.bredband2.com (Eggdrop!beer@eggdrop/bot) (active 14:58)
* [ 10] *!*@flow.users.undernet.org (Eggdrop!beer@eggdrop/bot) (active 14:58)
* [ 11] Eggybot!*@* (Eggdrop!beer@eggdrop/bot) (active 14:58)
Channel bans for #foo:  (* = not placed by bot)
Channel bans for #eggtest:  (* = not placed by bot)
  [ 13] *!*@aol.com (perm)
        -HQ: requested
        Created 23:14
* [ 14] *!*@eggtest.com (Geo!~scase@user/geo) (active 14:34)
Use '.bans all' to see the total list.

with a console set to *, use .bans all to show all global and channel bans stored on the bot

.bans all
[04:02:24] #-HQ# bans all
Global bans:   (! = not active on #eggdroptest)
! [  1] *!*@qwer.com (perm)
        -HQ: requested
        Created 21:35
! [  2] [email protected]* (perm)
        -HQ: requested
        Created 1405 days ago
! [  3] *!*@423456789.523456789.62* (perm) (sticky)
        -HQ: requested
        Created 1405 days ago
! [  4] *!*@asdfasdf.com (perm)
        -HQ: requested
        Created 1405 days ago
Channel bans for #eggdroptest:   (! = not active, * = not placed by bot)
! [  5] *!*@asf.com (perm)
        -HQ: requested
        Created 21:35
* [  6] *!*@217-115-40-234.cust.bredband2.com (Eggdrop!beer@eggdrop/bot) (active 18:40)
* [  7] *!*@flow.users.undernet.org (Eggdrop!beer@eggdrop/bot) (active 18:40)
* [  8] Eggybot!*@* (Eggdrop!beer@eggdrop/bot) (active 18:40)
Channel bans for #foo:   (! = not active, * = not placed by bot)
! [  9] *!*@sol.com (perm)
        -HQ: requested
        Created 21:35
Channel bans for #eggtest:   (! = not active, * = not placed by bot)
  [ 10] *!*@aol.com (perm)
        -HQ: requested
        Created 23:14
* [ 11] *!*@eggtest.com (Geo!~scase@user/geo) (active 18:16)

with a console set to *, use matching to match all bans matching a mask

.bans *asf*
[04:06:55] #-HQ# bans *asf*
Global bans:
Channel bans for #eggdroptest:  (* = not placed by bot)
! [  8] *!*@asf.com (perm)
        -HQ: requested
        Created 21:35
Channel bans for #foo:  (* = not placed by bot)
Channel bans for #eggtest:  (* = not placed by bot)

@vanosg vanosg added this to the v1.10.0 milestone Jan 14, 2024
@thommey
Copy link
Member

thommey commented Jan 19, 2024

I very much like the change to the display, but how does this interact with ".-ban 12" that you usually use right after .bans to delete a specific bind number?

@vanosg
Copy link
Member Author

vanosg commented Jan 20, 2024

The number listed deletes that ban. If you are viewing bans on a different channel than console, you can do (example) .-ban 8 #eggtest and it will delete the ban that ls listed as 8 for that channel, not the console channel

@vanosg vanosg merged commit 26aa8cb into develop Jan 20, 2024
2 checks passed
@vanosg vanosg deleted the bug/reportchanbans branch February 5, 2024 04:31
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.

[1.9.2] Problem with .bans
2 participants