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

SimpleUserModeHandler Class Reference

A prebuilt mode handler which handles a simple user mode, e.g. More...

#include <mode.h>

Inheritance diagram for SimpleUserModeHandler:

Inheritance graph
[legend]
Collaboration diagram for SimpleUserModeHandler:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SimpleUserModeHandler (InspIRCd *Instance, char modeletter)
virtual ~SimpleUserModeHandler ()
virtual ModeAction OnModeChange (User *source, User *dest, Channel *channel, std::string &parameter, bool adding, bool servermode=false)
 Called when a mode change for your mode occurs.

Detailed Description

A prebuilt mode handler which handles a simple user mode, e.g.

no parameters, usable by any user, with no extra behaviour to the mode beyond the basic setting and unsetting of the mode, not allowing the mode to be set if it is already set and not allowing it to be unset if it is already unset. An example of a simple user mode is user mode +w.

Definition at line 313 of file mode.h.


Constructor & Destructor Documentation

SimpleUserModeHandler::SimpleUserModeHandler InspIRCd Instance,
char  modeletter
 

Definition at line 159 of file mode.cpp.

SimpleUserModeHandler::~SimpleUserModeHandler  )  [virtual]
 

Definition at line 163 of file mode.cpp.


Member Function Documentation

ModeAction SimpleUserModeHandler::OnModeChange User source,
User dest,
Channel channel,
std::string parameter,
bool  adding,
bool  servermode = false
[virtual]
 

Called when a mode change for your mode occurs.

Parameters:
source Contains the user setting the mode.
dest For usermodes, contains the destination user the mode is being set on. For channelmodes, this is an undefined value.
channel For channel modes, contains the destination channel the modes are being set on. For usermodes, this is an undefined value.
parameter The parameter for your mode, if you indicated that your mode requires a parameter when being set or unset. Note that if you alter this value, the new value becomes the one displayed and send out to the network, also, if you set this to an empty string but you specified your mode REQUIRES a parameter, this is equivalent to returning MODEACTION_DENY and will prevent the mode from being displayed.
adding This value is true when the mode is being set, or false when it is being unset.
Returns:
MODEACTION_ALLOW to allow the mode, or MODEACTION_DENY to prevent the mode, also see the description of 'parameter'.

Reimplemented from ModeHandler.

Definition at line 175 of file mode.cpp.

References User::IsModeSet(), MODEACTION_ALLOW, MODEACTION_DENY, and User::SetMode().


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