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

ModuleGecosBan Class Reference

Inheritance diagram for ModuleGecosBan:

Inheritance graph
[legend]
Collaboration diagram for ModuleGecosBan:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleGecosBan (InspIRCd *Me)
virtual ~ModuleGecosBan ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual int OnUserPreJoin (User *user, Channel *c, const char *cname, std::string &privs, const std::string &key)
 Called whenever a user is about to join a channel, before any processing is done.
virtual void On005Numeric (std::string &output)
 Called when a 005 numeric is about to be output.
 ModuleGecosBan (InspIRCd *Me)
virtual ~ModuleGecosBan ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual int OnCheckInvite (User *user, Channel *c)
 Called whenever a user joins a channel, to determine if invite checks should go ahead or not.
virtual int OnUserPreJoin (User *user, Channel *c, const char *cname, std::string &privs, const std::string &key)
 Called whenever a user is about to join a channel, before any processing is done.
virtual void On005Numeric (std::string &output)
 Called when a 005 numeric is about to be output.

Detailed Description

Definition at line 18 of file m_gecosban.cpp.


Constructor & Destructor Documentation

ModuleGecosBan::ModuleGecosBan InspIRCd Me  )  [inline]
 

Definition at line 22 of file m_gecosban.cpp.

References ModuleManager::Attach(), I_On005Numeric, I_OnUserPreJoin, InspIRCd::Modules, and Module::ServerInstance.

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

Definition at line 28 of file m_gecosban.cpp.

ModuleGecosBan::ModuleGecosBan InspIRCd Me  )  [inline]
 

Definition at line 25 of file m_operinvex.cpp.

References ModuleManager::Attach(), I_On005Numeric, I_OnUserPreJoin, InspIRCd::Modules, and Module::ServerInstance.

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

Definition at line 31 of file m_operinvex.cpp.


Member Function Documentation

virtual Version ModuleGecosBan::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 35 of file m_operinvex.cpp.

References API_VERSION, and VF_VENDOR.

virtual Version ModuleGecosBan::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 32 of file m_gecosban.cpp.

References API_VERSION, and VF_VENDOR.

virtual void ModuleGecosBan::On005Numeric std::string output  )  [inline, virtual]
 

Called when a 005 numeric is about to be output.

The module should modify the 005 numeric if needed to indicate its features.

Parameters:
output The 005 string to be modified if neccessary.

Reimplemented from Module.

Definition at line 75 of file m_operinvex.cpp.

References InspIRCd::AddExtBanChar(), and Module::ServerInstance.

virtual void ModuleGecosBan::On005Numeric std::string output  )  [inline, virtual]
 

Called when a 005 numeric is about to be output.

The module should modify the 005 numeric if needed to indicate its features.

Parameters:
output The 005 string to be modified if neccessary.

Reimplemented from Module.

Definition at line 54 of file m_gecosban.cpp.

References InspIRCd::AddExtBanChar(), and Module::ServerInstance.

virtual int ModuleGecosBan::OnCheckInvite User user,
Channel c
[inline, virtual]
 

Called whenever a user joins a channel, to determine if invite checks should go ahead or not.

This method will always be called for each join, wether or not the channel is actually +i, and determines the outcome of an if statement around the whole section of invite checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event.

Parameters:
user The user joining the channel
chan The channel being joined
Returns:
1 to explicitly allow the join, 0 to proceed as normal

Reimplemented from Module.

Definition at line 40 of file m_operinvex.cpp.

References ModuleManager::Find(), IS_LOCAL, IS_OPER, InspIRCd::Modules, User::oper, and Module::ServerInstance.

virtual int ModuleGecosBan::OnUserPreJoin User user,
Channel c,
const char *  cname,
std::string privs,
const std::string key
[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 58 of file m_operinvex.cpp.

References ERR_BANNEDFROMCHAN, IS_LOCAL, IS_OPER, Channel::IsExtBanned(), Channel::name, User::nick, User::oper, and User::WriteNumeric().

virtual int ModuleGecosBan::OnUserPreJoin User user,
Channel c,
const char *  cname,
std::string privs,
const std::string key
[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 37 of file m_gecosban.cpp.

References ERR_BANNEDFROMCHAN, User::fullname, IS_LOCAL, Channel::IsExtBanned(), Channel::name, User::nick, and User::WriteNumeric().


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