[eggheads-patches] PATCH1.6: new_i_flag.patch

David Sinkler davidsinkler at yahoo.com
Sun Sep 13 15:15:32 CST 2009

Hello! I'm submitting a new patch for Eggdrop 1.6, called new_i_flag.patch.

The exact version of the source that I was using was Eggdrop1.6.19+ctcpfix, and I'd be happy to try and re-apply and re-generate this patch on a newer version of code if necessary. Please note that this is my first time submitting a patch, and I hope I've done everything correctly as described in the documentation. Please let me know if I need to do something different, I'd be happy to re-submit.

The details are as follows:

This patch introduces a new flag ( +i ) into the eggdrop bot main source code and irc.mod.

Currently, bot masters (+m) and channel masters ( |+m ) were allowed by the bot to set any mode and op/deop anyone they wanted without any argument or reversal from the bot if certain channel settings were in place. For example: +m users are allowed (by the bot) to op someone without +o in a +bitch channel, or deop +o operator in a channel that's set to +protetops. They're also allowed to set and unset "locked" modes like +t and +n.

I thought that it would be good idea to separate the override privileges from the rest of the privileges that +m allows, so that the bot's channel settings (and in some cases user flags like +d) could be strictly adhered to by the bot, if so desired. For example, with this new flag, if someone really wants +bitch to apply to everyone, all the owner/channel owner has to do is not give any users the new +i flag, and then even masters/owners will not be able to manually op someone in that channel unless they're +o with the bot). 

Because there were so few choices of available flag letters, I thought that +i would be a good choice for this one, because it's available as a global flag and a channel flag. I called it "ignore modes" so that the letter will match up with the meaning. It's accurate too: the bot basically ignores most mode changes by the +i flagged user.

I've also added +i to ".help whois," so if you want that brief definition for the help file, it's:
Valid global flags:
      %bi%b - ignore modes (bot ignores most mode changes and op/deops made by user)
 (Channel flags):
      %bi%b - ignore modes (bot ignores most mode changes and op/deops made by user)


Users (or bots) with the +i flag can make the following mode changes, without them being reversed (undone) by the bot:
* Change the main channel modes (+t, +n, +i, +s, +p, +k, +l, +m, etc...) no matter what they are set to in "chanset: chanmode"
* Give ops to users who don't have the +o flag (or aren't recognized as such) when +bitch is set
* Give ops to users who have the +d flag set (or aren't recognized as such)
* Give half-ops to users who have the +r flag set (or aren't recognized as such)
* Deop +o (recognized) users when +protectops is set
* De-halfop +l (recognized) users when +protecthalfops is set
* Deop +f (recognized) users when +protectfriends is set
* Set bans/exempts/invites when a channel is set to -user(bans/exempts/invites)
* (Possibly make other mode changes that +m master once allowed, which I may not yet be aware of)

Global +i can only be set (using .chattr) and removed by global owners
Channel +i can only be set (using .chattr) by channel owners and global owners

Non-owners can't use +host/-host, chpass or adduser on users with global +i (unless the command is used by the +i user themselves)
Non-owners can't use +host/-host on users with channel +i (unless +/-host is used by the +i user themselves)

+m masters are now held strictly to the bot's channel settings, and flags like the +d user flag on other users (unless that +m also has +i, of course)
Known bugs and issues:

* I've implemented some protection to try and prevent global and channel masters from illicitly gaining +i using .chpass or +host/-host on a user who already has +i. This works, however a master could gain channel +i using .adduser or .chpass if the target handle has +i on a channel, but not global +i. Hopefully this won't be too much of an issue, but if there's a way to have .adduser and .chpass check for channel +i, the problem should be solved at that point.
* Master override didn't apply to bans that are set to .stick, so the bot still won't allow +i users to remove sticky bans manually

If owners still want masters to have override privileges, give them +i - a simple TCL script should be able to give +i to all +m users if so desired.


It's my hope that this flag will be implemented into all new releases of eggdrop, because I think it's a great idea and it gives owners more control over how the bot behaves, and I think that bots should be a bit more strict in enforcement of channel settings, except as allowed by their owners.

Thank you again,

David Sinkler
"ATAD" on DALnet

-------------- next part --------------
A non-text attachment was scrubbed...
Name: new_i_flag.patch
Type: application/octet-stream
Size: 16739 bytes
Desc: not available
URL: <http://lists.eggheads.org/pipermail/patches/attachments/20090913/abb2a90e/attachment.obj>

More information about the Patches mailing list