Bans, Invites and Exempts

==========================
Bans, Invites, and Exempts
==========================


  Eggdrop handles bans, exempts
  and invites in various ways, and this file is intended to help clarify how
  these modes are used within the bot. From here on, 'mode' applies to all
  three modes (bans, exempts, and invites) unless otherwise specified. There
  are three types of modes:

    Global modes   
                   These modes will be active on every channel the bot
                   monitors. Some will "expire" after a while (be removed
                   automatically). Others are considered "permanent" and
                   can only be removed by a master.

    Channel modes  
                   These modes are active only on one channel, and are almost
                   always temporary modes that expire after an hour or so
                   (depending on how long you've specified in the config
                   file). Usually they're created by a Tcl script of some
                   sort.

    Non-bot modes  
                   These are modes that were not placed by the bot. They
                   can be removed by anyone on the channel. The other two
                   types of modes are protected by the bot (unless the
                   channel settings specify otherwise), and have to be
                   removed via the bot.

  Bans can also be either sticky or unsticky:

    Sticky     
               These modes are usually set by a user using the ".stick"
               command. Modes with this attribute are attempted to be kept
               active on the channel at all times by the bot, even if the
               channel is set to use dynamic modes. Obviously, if the channel
               isn't set to use dynamic modes, this won't have any effect.

    Un-sticky  
               These modes are the style that Eggdrop sets by default when
               a user uses one of the commands that result in a mode. This
               attribute means that the ban will be removed if using dynamic
               modes after a certain time. If a mode is "sticky" and you wish
               to set it to be "un-sticky", use the ".unstick" command.

  Mode behavior:

    Bans     
             If the channel is supporting dynamic bans, then the ban is
             set when a user with a matching hostmask joins the channel;
             otherwise, the modes are permanently set. On a channel with
             dynamic bans, the ban expires after 'ban-time' minutes (which
             is specified in the config file).

    Exempts  
             If the channel is not supporting dynamic exempts, then they
             are set at all times. Otherwise, the exemption is set when a
             ban is placed whose host includes that covered by the exempt.
             The exempt will remain in place for at least 'exempt-time'
             minutes (defined in config file) or until after the
             corresponding ban has been removed, whichever happens last.

    Invites  
             If the channel does not support dynamic invites, then they
             are set at all times. Otherwise, the invite is set when the
             channel is +i and a user requests an invite into the channel.
             The invite then remains set for 'invite-time' minutes
             (defined in config file) or until the channel goes -i again,
             whichever happens last.

-----------------------
Extended Bans (EXTBANS)
-----------------------

As of version 1.10.2, Eggdrop incorportes extended ban support. Exteneded bans give new functionality to the traditional IRC ban through the use of new prefix to the banmask. Eggdrop currently only supports single-character extended ban flags, not longform (ie "a", but not "account").

When a ban is added through Eggdrop with the .+extban command, Eggdrop automatically takes the EXTBAN prefix for the server and prepends it to the EXTBAN flag the user provides. This is the preferred method of adding extbans to ensure they are functionally added to Eggdrop

If you add an extended ban via .+ban instead of .+extban, Eggdrop assumes you know what you are doing and gives the user lattitude to set what they want. When an extban ban is added through Eggdrop with the .+ban command, Eggdrop identifies and parses the supplied mask as extban syntax before storing it. Eggdrop will then check whether the provided extban flag is supported by the current server, either through ACCOUNTEXTBAN or the advertised EXTBAN flags. If the flag is not supported, Eggdrop will save the ban internally but will not set it on the channel until connected to a server that supports that flag. If the flag is supported and locally matchable (ACCOUNTEXTBAN or one of UABCmNpqQT), Eggdrop will store it like a normal ban. 

However, some extended bans cannot be matched by Eggdrop (for example, an extended ban that matches if a user is on a channel. If the extban is a valid flag but cannot be matched by Eggdrop, it is automatically stored as sticky. Because it cannot be matched, it will be kept set on the channel despite any dynamic-ban channel status set.

If a user or server sets an extended ban directly on the channel and it contains a banmask that Eggdrop can match against, Eggdrop tracks it as a normal channel banlist entry, subject to normal channel banlist handling, including removal after ban-time when +dynamicbans is enabled (unless it corresponds to a sticky internal ban).

The only extended bans that can be enforced with a kick via +enforcebans are the value of ACCOUNTEXTBAN, and U. These extended ban flags are eligible for Eggdrop’s local kick/enforcement behavior; other matchable extbans are set and tracked like bans but Eggdrop does lacks the ability to know if the user violates them and cannot kick users itself.
