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

ModuleMsgFlood Class Reference

Inheritance diagram for ModuleMsgFlood:

Inheritance graph
[legend]
Collaboration diagram for ModuleMsgFlood:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleMsgFlood (InspIRCd *Me)
int ProcessMessages (User *user, Channel *dest, const std::string &text)
virtual int OnUserPreMessage (User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
 Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done.
virtual int OnUserPreNotice (User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
 Called whenever a user is about to NOTICE A user or a channel, before any processing is done.
void OnChannelDelete (Channel *chan)
 Called whenever a channel is deleted, either by QUIT, KICK or PART.
virtual ~ModuleMsgFlood ()
virtual Version GetVersion ()
 Returns the version number of a Module.

Private Attributes

MsgFloodmf

Detailed Description

Definition at line 202 of file m_messageflood.cpp.


Constructor & Destructor Documentation

ModuleMsgFlood::ModuleMsgFlood InspIRCd Me  )  [inline]
 

Definition at line 209 of file m_messageflood.cpp.

References ModeParser::AddMode(), ModuleManager::Attach(), I_OnChannelDelete, I_OnUserPreMessage, I_OnUserPreNotice, mf, InspIRCd::Modes, InspIRCd::Modules, and Module::ServerInstance.

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

Definition at line 288 of file m_messageflood.cpp.

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


Member Function Documentation

virtual Version ModuleMsgFlood::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 294 of file m_messageflood.cpp.

References API_VERSION, VF_COMMON, and VF_VENDOR.

void ModuleMsgFlood::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 277 of file m_messageflood.cpp.

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

virtual int ModuleMsgFlood::OnUserPreMessage User user,
void *  dest,
int  target_type,
std::string text,
char  status,
CUList exempt_list
[inline, virtual]
 

Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done.

Returning any nonzero value 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 filter or redirect messages. target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, you must cast dest to a User* otherwise you must cast it to a Channel*, this is the details of where the message is destined to be sent.

Parameters:
user The user sending the message
dest The target of the message (Channel* or User*)
target_type The type of target (TYPE_USER or TYPE_CHANNEL)
text Changeable text being sent by the user
status The status being used, e.g. PRIVMSG #chan has status== '@', 0 to send to everyone.
exempt_list A list of users not to send to. For channel messages, this will usually contain just the sender. It will be ignored for private messages.
Returns:
1 to deny the NOTICE, 0 to allow it

Reimplemented from Module.

Definition at line 261 of file m_messageflood.cpp.

References ProcessMessages(), and TYPE_CHANNEL.

virtual int ModuleMsgFlood::OnUserPreNotice User user,
void *  dest,
int  target_type,
std::string text,
char  status,
CUList exempt_list
[inline, virtual]
 

Called whenever a user is about to NOTICE A user or a channel, before any processing is done.

Returning any nonzero value 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 filter or redirect messages. target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, you must cast dest to a User* otherwise you must cast it to a Channel*, this is the details of where the message is destined to be sent. You may alter the message text as you wish before relinquishing control to the next module in the chain, and if no other modules block the text this altered form of the text will be sent out to the user and possibly to other servers.

Parameters:
user The user sending the message
dest The target of the message (Channel* or User*)
target_type The type of target (TYPE_USER or TYPE_CHANNEL)
text Changeable text being sent by the user
status The status being used, e.g. PRIVMSG #chan has status== '@', 0 to send to everyone.
exempt_list A list of users not to send to. For channel notices, this will usually contain just the sender. It will be ignored for private notices.
Returns:
1 to deny the NOTICE, 0 to allow it

Reimplemented from Module.

Definition at line 269 of file m_messageflood.cpp.

References ProcessMessages(), and TYPE_CHANNEL.

int ModuleMsgFlood::ProcessMessages User user,
Channel dest,
const std::string text
[inline]
 

Definition at line 220 of file m_messageflood.cpp.

References floodsettings::addmessage(), floodsettings::ban, CHANOPS_EXEMPT, floodsettings::clear(), InspIRCd::FakeClient, Extensible::GetExt(), Channel::GetStatus(), IS_LOCAL, floodsettings::lines, MAXBUF, Channel::name, InspIRCd::PI, floodsettings::secs, InspIRCd::SendMode(), ProtocolInterface::SendModeStr(), Module::ServerInstance, Channel::ServerKickUser(), floodsettings::shouldkick(), and STATUS_OP.

Referenced by OnUserPreMessage(), and OnUserPreNotice().


Member Data Documentation

MsgFlood* ModuleMsgFlood::mf [private]
 

Definition at line 205 of file m_messageflood.cpp.

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


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