Conversation
|
|
||
| egg_snprintf(user, sizeof user, "%s!%s", m->nick, m->userhost); | ||
| if (u_match_mask(global_bans, user) || u_match_mask(chan->bans, user)) { | ||
| refresh_ban_kick(chan, user, m->nick); |
There was a problem hiding this comment.
refresh_ban_kick only executes the kick, should this possibly be (maybe in addition) check_this_ban to set the ban if it is dynamic?
There was a problem hiding this comment.
fun fact, check_this_ban doesn't appear to be used anywhere else in code? is there some other newer code being used?
There was a problem hiding this comment.
It is used through irc.mod exports, see IRC_CHECK_THIS_BAN, but not (yet) by irc.mod directly
| memcpy(nick, mask, nicklen); | ||
| nick[nicklen] = 0; | ||
| if (nick[0]) { | ||
| m = find_member_from_nick(nick); |
There was a problem hiding this comment.
this searches the nickname in any channel instead of the channel we called u_match_mask for, what do you think about creating a new matching function that also takes a channel so we have a specific m?
There was a problem hiding this comment.
I think we could include a channel, but do we need to? I don't have a strong reason for this, but I feel finding any record for a nick is better than limiting it to the channel, just in case for some reason the record hasn't been created/already been deleted for the channel? It's not a strong case, but I don't know why we would limit it to just the channel
There was a problem hiding this comment.
it's the consistency thing, this only grabs m->account from a "random" channel, I think when we did accounts we made sure it is always copied properly and should always be the same on all channels, then this is fine
There was a problem hiding this comment.
Ah, I think i fussed about this over there, too haha. nick will always be nick regardless of the channel. Tell me if you're very motivated to create a new function just for this (other places?), otherwise I'd just leave it as is because I don't see the harm (said every dev who ever introduced a vulnerability)
| } | ||
|
|
||
|
|
||
| static void cmd_pls_extban(struct userrec *u, int idx, char *par) |
There was a problem hiding this comment.
Do you want to keep this then?
If yes, I would consider adding cmd_mns_extban as well to correspond.
There was a problem hiding this comment.
.-ban works for all bans, extban or not. I acknowledge it is confusing, but I don't know what this command would add since you're either using a number or a mask, both of which work via .-ban
I'll add that I implemented cmd_pls_extban because it takes needing to know the extban prefix and specific banmask formatting out of the users hands... I thought this is a bonus. .+ban should still work if you want to do it manually as well.
There was a problem hiding this comment.
.+ban also works on all bans, no? Maybe you can explain more why .+extban adds value but .-extban would not
There was a problem hiding this comment.
For sure- as a novice user, I might not know that $ and ~ are different on different servers, or what flags are allowed and not allowed on a server. .+extban checks all this; .+ban will just set what you set. In short, there is optionality in how to build a ban, but deleting a ban is still pretty simple and intuitive.
Patch by: Geo
One-line summary:
Add extban support
Additional description (if needed):
This PR does the following:
Adds the '.+extban' command which adds the ability to insert an extban flag to a ban. This is essentially a wrapper for the .+ban command. This was allegedly done for backwards compatibility, but maybe it's not needed?
Stores the EXTBAN 005 flags
Stores the ACCOUNTEXTBAN 005 flag
Removes the previous banmask "fixing" that was preventing Eggdrop from creating extban-formatted banmasks. These banmaks are now able to be stored in the banlist just like a normal ban.
Handles extbans in two ways- enforceable, and non-enforceable
Any extban flag can be used create and store an internal ban in Eggdrop, but Eggdrop will only activate an extban on channel if the server allows that flag to be created (ie, stored in EXTBAN 005 flag)
TO DOs:
[ ]
Add in more enforceable flags- will do in future PR[X] Add Tcl variables
[X] Switch from enforceable-default to sticky-default