InspIRCd  2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations
Public Member Functions | List of all members
SimpleUserModeHandler Class Reference

#include <mode.h>

Inheritance diagram for SimpleUserModeHandler:
ModeHandler ServiceProvider classbase

Public Member Functions

 SimpleUserModeHandler (Module *Creator, const std::string &Name, char modeletter)
 
virtual ModeAction OnModeChange (User *source, User *dest, Channel *channel, std::string &parameter, bool adding)
 
- Public Member Functions inherited from ModeHandler
 ModeHandler (Module *me, const std::string &name, char modeletter, ParamSpec params, ModeType type)
 
virtual CullResult cull ()
 
bool IsListMode ()
 
char GetPrefix () const
 
virtual unsigned int GetPrefixRank ()
 
ModeType GetModeType () const
 
TranslateType GetTranslateType () const
 
bool NeedsOper () const
 
int GetNumParams (bool adding)
 
char GetModeChar ()
 
virtual std::string GetUserParameter (User *useor)
 
virtual ModResult AccessCheck (User *source, Channel *channel, std::string &parameter, bool adding)
 
virtual void DisplayList (User *user, Channel *channel)
 
virtual void OnParameterMissing (User *user, User *dest, Channel *channel)
 
virtual void DisplayEmptyList (User *user, Channel *channel)
 
virtual bool ResolveModeConflict (std::string &their_param, const std::string &our_param, Channel *channel)
 
virtual void RemoveMode (User *user, irc::modestacker *stack=NULL)
 
virtual void RemoveMode (Channel *channel, irc::modestacker *stack=NULL)
 
unsigned int GetLevelRequired () const
 
- Public Member Functions inherited from ServiceProvider
 ServiceProvider (Module *Creator, const std::string &Name, ServiceType Type)
 

Additional Inherited Members

- Public Attributes inherited from ServiceProvider
ModuleRef creator
 
const std::string name
 
const ServiceType service
 
- Protected Attributes inherited from ModeHandler
TranslateType m_paramtype
 
ParamSpec parameters_taken
 
char mode
 
char prefix
 
bool oper
 
bool list
 
ModeType m_type
 
int levelrequired
 

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.

Member Function Documentation

ModeAction SimpleUserModeHandler::OnModeChange ( User source,
User dest,
Channel channel,
std::string &  parameter,
bool  adding 
)
virtual

Called when a mode change for your mode occurs.

Parameters
sourceContains the user setting the mode.
destFor usermodes, contains the destination user the mode is being set on. For channelmodes, this is an undefined value.
channelFor channel modes, contains the destination channel the modes are being set on. For usermodes, this is an undefined value.
parameterThe 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.
addingThis 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.


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