ModeChannelLimit Class Reference
Channel mode +l.
More...
#include <cmode_l.h>
Inheritance diagram for ModeChannelLimit:
[legend]Collaboration diagram for ModeChannelLimit:
[legend]List of all members.
|
Public Member Functions |
| | ModeChannelLimit (InspIRCd *Instance) |
| ModeAction | OnModeChange (User *source, User *dest, Channel *channel, std::string ¶meter, bool adding, bool servermode) |
| | Called when a mode change for your mode occurs.
|
| ModePair | ModeSet (User *source, User *dest, Channel *channel, const std::string ¶meter) |
| | When a remote server needs to bounce a set of modes, it will call this method for every mode in the mode string to determine if the mode is set or not.
|
| bool | CheckTimeStamp (time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, Channel *channel) |
| | If your mode needs special action during a server sync to determine which side wins when comparing timestamps, override this function and use it to return true or false.
|
Detailed Description
Channel mode +l.
Definition at line 20 of file cmode_l.h.
Constructor & Destructor Documentation
| ModeChannelLimit::ModeChannelLimit |
( |
InspIRCd * |
Instance |
) |
|
|
Member Function Documentation
| bool ModeChannelLimit::CheckTimeStamp |
( |
time_t |
theirs, |
|
|
time_t |
ours, |
|
|
const std::string & |
their_param, |
|
|
const std::string & |
our_param, |
|
|
Channel * |
channel |
|
) |
[virtual] |
|
|
|
If your mode needs special action during a server sync to determine which side wins when comparing timestamps, override this function and use it to return true or false.
The default implementation just returns true if theirs < ours. This will only be called for non-listmodes with parameters, when adding the mode and where theirs == ours (therefore the default implementation will always return false). - Parameters:
-
| theirs | The timestamp of the remote side |
| ours | The timestamp of the local side |
| their_param | Their parameter if the mode has a parameter |
| our_param | Our parameter if the mode has a parameter |
| channel | The channel we are checking against |
- Returns:
- True if the other side wins the merge, false if we win the merge for this mode.
Reimplemented from ModeHandler.
Definition at line 37 of file cmode_l.cpp. |
|
|
When a remote server needs to bounce a set of modes, it will call this method for every mode in the mode string to determine if the mode is set or not.
- Parameters:
-
| source | of the mode change, this will be NULL for a server mode |
| dest | Target user of the mode change, if this is a user mode |
| channel | Target channel of the mode change, if this is a channel mode |
| parameter | The parameter given for the mode change, or an empty string |
- Returns:
- The first value of the pair should be true if the mode is set with the given parameter. In the case of permissions modes such as channelmode +o, this should return true if the user given as the parameter has the given privilage on the given channel. The string value of the pair will hold the current setting for this mode set locally, when the bool is true, or, the parameter given. This allows the local server to enforce our locally set parameters back to a remote server.
Reimplemented from ModeHandler.
Definition at line 24 of file cmode_l.cpp.
References Channel::GetModeParameter(). |
|
|
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 43 of file cmode_l.cpp.
References CM_LIMIT, ConvToStr(), Channel::GetModeParameter(), MODEACTION_ALLOW, MODEACTION_DENY, Channel::modes, and Channel::SetModeParam(). |
The documentation for this class was generated from the following files: