#include <mode.h>
|
| ModeWatcher (Module *creator, char modeletter, ModeType type) |
|
virtual | ~ModeWatcher () |
|
char | GetModeChar () |
|
ModeType | GetModeType () |
|
virtual bool | BeforeMode (User *source, User *dest, Channel *channel, std::string ¶meter, bool adding, ModeType type) |
|
virtual void | AfterMode (User *source, User *dest, Channel *channel, const std::string ¶meter, bool adding, ModeType type) |
|
virtual CullResult | cull () |
|
The ModeWatcher class can be used to alter the behaviour of a mode implemented by the core or by another module. To use ModeWatcher, derive a class from it, and attach it to the mode using Server::AddModeWatcher and Server::DelModeWatcher. A ModeWatcher will be called both before and after the mode change.
◆ ModeWatcher()
ModeWatcher::ModeWatcher |
( |
Module * |
creator, |
|
|
char |
modeletter, |
|
|
ModeType |
type |
|
) |
| |
The constructor initializes the mode and the mode type
◆ ~ModeWatcher()
ModeWatcher::~ModeWatcher |
( |
| ) |
|
|
virtual |
The default destructor does nothing.
◆ AfterMode()
void ModeWatcher::AfterMode |
( |
User * |
source, |
|
|
User * |
dest, |
|
|
Channel * |
channel, |
|
|
const std::string & |
parameter, |
|
|
bool |
adding, |
|
|
ModeType |
type |
|
) |
| |
|
virtual |
After the mode character has been processed by the ModeHandler, this method will be called.
- Parameters
-
source | The sender of the mode |
dest | The target user for the mode, if you are watching a user mode |
channel | The target channel for the mode, if you are watching a channel mode |
parameter | The parameter of the mode, if the mode is supposed to have a parameter. You cannot alter the parameter here, as the mode handler has already processed it. |
adding | True if the mode is being added and false if it is being removed |
type | The mode type, either MODETYPE_USER or MODETYPE_CHANNEL |
◆ BeforeMode()
bool ModeWatcher::BeforeMode |
( |
User * |
source, |
|
|
User * |
dest, |
|
|
Channel * |
channel, |
|
|
std::string & |
parameter, |
|
|
bool |
adding, |
|
|
ModeType |
type |
|
) |
| |
|
virtual |
Before the mode character is processed by its handler, this method will be called.
- Parameters
-
source | The sender of the mode |
dest | The target user for the mode, if you are watching a user mode |
channel | The target channel for the mode, if you are watching a channel mode |
parameter | The parameter of the mode, if the mode is supposed to have a parameter. If you alter the parameter you are given, the mode handler will see your atered version when it handles the mode. |
adding | True if the mode is being added and false if it is being removed |
type | The mode type, either MODETYPE_USER or MODETYPE_CHANNEL |
- Returns
- True to allow the mode change to go ahead, false to abort it. If you abort the change, the mode handler (and ModeWatcher::AfterMode()) will never see the mode change.
◆ GetModeChar()
char ModeWatcher::GetModeChar |
( |
| ) |
|
Get the mode character being watched
- Returns
- The mode character being watched
◆ GetModeType()
ModeType ModeWatcher::GetModeType |
( |
| ) |
|
Get the mode type being watched
- Returns
- The mode type being watched (user or channel)
◆ m_type
ModeType ModeWatcher::m_type |
|
protected |
The mode type being watched (user or channel)
◆ mode
The mode letter this class is watching
The documentation for this class was generated from the following files: