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

ChanProtect Class Reference

Abstraction of FounderProtectBase for channel mode +a. More...

Inheritance diagram for ChanProtect:

Inheritance graph
[legend]
Collaboration diagram for ChanProtect:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ChanProtect (InspIRCd *Instance, char my_prefix, bool &depriv_self, bool &depriv_others)
unsigned int GetPrefixRank ()
 Get the 'value' of this modes prefix.
ModePair ModeSet (User *source, User *dest, Channel *channel, const std::string &parameter)
void RemoveMode (Channel *channel, irc::modestacker *stack)
 When a MODETYPE_CHANNEL mode handler is being removed, the server will call this method for every channel on the server.
void RemoveMode (User *user, irc::modestacker *stack)
 When a MODETYPE_USER mode handler is being removed, the server will call this method for every user on the server.
ModeAction OnModeChange (User *source, User *dest, Channel *channel, std::string &parameter, bool adding, bool)
 Called when a mode change for your mode occurs.
virtual void DisplayList (User *user, Channel *channel)

Detailed Description

Abstraction of FounderProtectBase for channel mode +a.

Definition at line 223 of file m_chanprotect.cpp.


Constructor & Destructor Documentation

ChanProtect::ChanProtect InspIRCd Instance,
char  my_prefix,
bool &  depriv_self,
bool &  depriv_others
[inline]
 

Definition at line 226 of file m_chanprotect.cpp.


Member Function Documentation

virtual void ChanProtect::DisplayList User user,
Channel channel
[inline, virtual]
 

Reimplemented from FounderProtectBase.

Definition at line 281 of file m_chanprotect.cpp.

References FounderProtectBase::DisplayList().

unsigned int ChanProtect::GetPrefixRank  )  [inline, virtual]
 

Get the 'value' of this modes prefix.

determines which to display when there are multiple. The mode with the highest value is ranked first. See the PrefixModeValue enum and Channel::GetPrefixValue() for more information.

Reimplemented from ModeHandler.

Definition at line 230 of file m_chanprotect.cpp.

References PROTECT_VALUE.

ModePair ChanProtect::ModeSet User source,
User dest,
Channel channel,
const std::string parameter
[inline]
 

Reimplemented from FounderProtectBase.

Definition at line 235 of file m_chanprotect.cpp.

References FounderProtectBase::ModeSet().

ModeAction ChanProtect::OnModeChange User source,
User dest,
Channel channel,
std::string parameter,
bool  adding,
bool 
[inline, 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 249 of file m_chanprotect.cpp.

References FounderProtectBase::CanRemoveOthers(), InspIRCd::FakeClient, FounderProtectBase::FindAndVerify(), FounderProtectBase::HandleChange(), IS_LOCAL, MODEACTION_DENY, Channel::name, FounderProtectBase::remove_own_privs, ModeHandler::ServerInstance, and InspIRCd::ULine().

void ChanProtect::RemoveMode User user,
irc::modestacker stack
[inline, virtual]
 

When a MODETYPE_USER mode handler is being removed, the server will call this method for every user on the server.

Your mode handler should remove its user mode from the user by sending the appropriate server modes using InspIRCd::SendMode(). The default implementation of this method can remove simple modes which have no parameters, and can be used when your mode is of this type, otherwise you must implement a more advanced version of it to remove your mode properly from each user.

Parameters:
user The user which the server wants to remove your mode from

Reimplemented from ModeHandler.

Definition at line 245 of file m_chanprotect.cpp.

void ChanProtect::RemoveMode Channel channel,
irc::modestacker stack
[inline, virtual]
 

When a MODETYPE_CHANNEL mode handler is being removed, the server will call this method for every channel on the server.

Your mode handler should remove its user mode from the channel by sending the appropriate server modes using InspIRCd::SendMode(). The default implementation of this method can remove simple modes which have no parameters, and can be used when your mode is of this type, otherwise you must implement a more advanced version of it to remove your mode properly from each channel. Note that in the case of listmodes, you should remove the entire list of items.

Parameters:
channel The channel which the server wants to remove your mode from

Reimplemented from ModeHandler.

Definition at line 240 of file m_chanprotect.cpp.

References FounderProtectBase::RemoveMode().


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