The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ModuleKickNoRejoin Class Reference

Inheritance diagram for ModuleKickNoRejoin:

Inheritance graph
[legend]
Collaboration diagram for ModuleKickNoRejoin:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleKickNoRejoin (InspIRCd *Me)
virtual int OnUserPreJoin (User *user, Channel *chan, const char *cname, std::string &privs, const std::string &keygiven)
 Called whenever a user is about to join a channel, before any processing is done.
virtual void OnUserKick (User *source, User *user, Channel *chan, const std::string &reason, bool &silent)
 Called whenever a user is kicked.
virtual void OnChannelDelete (Channel *chan)
 Called whenever a channel is deleted, either by QUIT, KICK or PART.
virtual void OnCleanup (int target_type, void *item)
 Called before your module is unloaded to clean up Extensibles.
virtual ~ModuleKickNoRejoin ()
virtual Version GetVersion ()
 Returns the version number of a Module.

Private Attributes

KickRejoinkr

Detailed Description

Definition at line 115 of file m_kicknorejoin.cpp.


Constructor & Destructor Documentation

ModuleKickNoRejoin::ModuleKickNoRejoin InspIRCd Me  )  [inline]
 

Definition at line 122 of file m_kicknorejoin.cpp.

References ModeParser::AddMode(), ModuleManager::Attach(), I_OnChannelDelete, I_OnCleanup, I_OnUserKick, I_OnUserPreJoin, kr, InspIRCd::Modes, InspIRCd::Modules, and Module::ServerInstance.

virtual ModuleKickNoRejoin::~ModuleKickNoRejoin  )  [inline, virtual]
 

Definition at line 205 of file m_kicknorejoin.cpp.

References ModeParser::DelMode(), kr, InspIRCd::Modes, and Module::ServerInstance.


Member Function Documentation

virtual Version ModuleKickNoRejoin::GetVersion  )  [inline, virtual]
 

Returns the version number of a Module.

The method should return a Version object with its version information assigned via Version::Version

Reimplemented from Module.

Definition at line 211 of file m_kicknorejoin.cpp.

References API_VERSION, VF_COMMON, and VF_VENDOR.

virtual void ModuleKickNoRejoin::OnChannelDelete Channel chan  )  [inline, virtual]
 

Called whenever a channel is deleted, either by QUIT, KICK or PART.

Parameters:
chan The channel being deleted

Reimplemented from Module.

Definition at line 187 of file m_kicknorejoin.cpp.

References dl, Extensible::GetExt(), and Extensible::Shrink().

Referenced by OnCleanup().

virtual void ModuleKickNoRejoin::OnCleanup int  target_type,
void *  item
[inline, virtual]
 

Called before your module is unloaded to clean up Extensibles.

This method is called once for every user and channel on the network, so that when your module unloads it may clear up any remaining data in the form of Extensibles added using Extensible::Extend(). If the target_type variable is TYPE_USER, then void* item refers to a User*, otherwise it refers to a Channel*.

Parameters:
target_type The type of item being cleaned
item A pointer to the item's class

Reimplemented from Module.

Definition at line 198 of file m_kicknorejoin.cpp.

References OnChannelDelete(), and TYPE_CHANNEL.

virtual void ModuleKickNoRejoin::OnUserKick User source,
User user,
Channel chan,
const std::string reason,
bool &  silent
[inline, virtual]
 

Called whenever a user is kicked.

If this method is called, the kick is already underway and cannot be prevented, so to prevent a kick, please use Module::OnUserPreKick instead of this method.

Parameters:
source The user issuing the kick
user The user being kicked
chan The channel the user is being kicked from
reason The kick reason
silent Change this to true if you want to conceal the PART command from the other users of the channel (useful for modules such as auditorium)

Reimplemented from Module.

Definition at line 173 of file m_kicknorejoin.cpp.

References dl, Extensible::Extend(), Extensible::GetExt(), Channel::GetModeParameter(), Channel::IsModeSet(), Module::ServerInstance, strtoint(), and InspIRCd::Time().

virtual int ModuleKickNoRejoin::OnUserPreJoin User user,
Channel chan,
const char *  cname,
std::string privs,
const std::string keygiven
[inline, virtual]
 

Called whenever a user is about to join a channel, before any processing is done.

Returning a value of 1 from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to mimic +b, +k, +l etc. Returning -1 from this function forces the join to be allowed, bypassing restrictions such as banlists, invite, keys etc.

IMPORTANT NOTE!

If the user joins a NEW channel which does not exist yet, OnUserPreJoin will be called BEFORE the channel record is created. This will cause Channel* chan to be NULL. There is very little you can do in form of processing on the actual channel record at this point, however the channel NAME will still be passed in char* cname, so that you could for example implement a channel blacklist or whitelist, etc.

Parameters:
user The user joining the channel
chan If the channel is a new channel, this will be NULL, otherwise it will be a pointer to the channel being joined
cname The channel name being joined. For new channels this is valid where chan is not.
privs A string containing the users privilages when joining the channel. For new channels this will contain "@". You may alter this string to alter the user's modes on the channel.
keygiven The key given to join the channel, or an empty string if none was provided
Returns:
1 To prevent the join, 0 to allow it.

Reimplemented from Module.

Definition at line 133 of file m_kicknorejoin.cpp.

References dl, ERR_DELAYREJOIN, Extensible::GetExt(), Channel::GetModeParameter(), Channel::name, User::nick, Module::ServerInstance, Extensible::Shrink(), InspIRCd::Time(), and User::WriteNumeric().


Member Data Documentation

KickRejoin* ModuleKickNoRejoin::kr [private]
 

Definition at line 118 of file m_kicknorejoin.cpp.

Referenced by ModuleKickNoRejoin(), and ~ModuleKickNoRejoin().


The documentation for this class was generated from the following file: