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

ModuleStripColor Class Reference

Inheritance diagram for ModuleStripColor:

Inheritance graph
[legend]
Collaboration diagram for ModuleStripColor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleStripColor (InspIRCd *Me)
virtual ~ModuleStripColor ()
virtual void On005Numeric (std::string &output)
 Called when a 005 numeric is about to be output.
virtual void ReplaceLine (std::string &sentence)
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.
virtual Version GetVersion ()
 Returns the version number of a Module.

Private Attributes

bool AllowChanOps
ChannelStripColorcsc
UserStripColorusc

Detailed Description

Definition at line 35 of file m_stripcolor.cpp.


Constructor & Destructor Documentation

ModuleStripColor::ModuleStripColor InspIRCd Me  )  [inline]
 

Definition at line 42 of file m_stripcolor.cpp.

References ModeParser::AddMode(), ModuleManager::Attach(), csc, I_On005Numeric, I_OnUserPreMessage, I_OnUserPreNotice, InspIRCd::Modes, InspIRCd::Modules, Module::ServerInstance, and usc.

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

Definition at line 53 of file m_stripcolor.cpp.

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


Member Function Documentation

virtual Version ModuleStripColor::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 144 of file m_stripcolor.cpp.

References API_VERSION, VF_COMMON, and VF_VENDOR.

virtual void ModuleStripColor::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 61 of file m_stripcolor.cpp.

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

virtual int ModuleStripColor::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 106 of file m_stripcolor.cpp.

References CHANOPS_EXEMPT, Channel::GetStatus(), IS_LOCAL, Channel::IsExtBanned(), Channel::IsModeSet(), User::IsModeSet(), ReplaceLine(), Module::ServerInstance, STATUS_OP, TYPE_CHANNEL, and TYPE_USER.

Referenced by OnUserPreNotice().

virtual int ModuleStripColor::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 139 of file m_stripcolor.cpp.

References OnUserPreMessage().

virtual void ModuleStripColor::ReplaceLine std::string sentence  )  [inline, virtual]
 

Definition at line 66 of file m_stripcolor.cpp.

Referenced by OnUserPreMessage().


Member Data Documentation

bool ModuleStripColor::AllowChanOps [private]
 

Definition at line 37 of file m_stripcolor.cpp.

ChannelStripColor* ModuleStripColor::csc [private]
 

Definition at line 38 of file m_stripcolor.cpp.

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

UserStripColor* ModuleStripColor::usc [private]
 

Definition at line 39 of file m_stripcolor.cpp.

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


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