The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download | Blog | Stats
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

BlockCaps Class Reference

Handles the +P channel mode. More...

Inheritance diagram for BlockCaps:

Inheritance graph
[legend]
Collaboration diagram for BlockCaps:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BlockCaps (InspIRCd *Instance)
ModeAction OnModeChange (userrec *source, userrec *dest, chanrec *channel, std::string &parameter, bool adding)
 Called when a mode change for your mode occurs.

Detailed Description

Handles the +P channel mode.

Definition at line 25 of file m_blockcaps.cpp.


Constructor & Destructor Documentation

BlockCaps::BlockCaps InspIRCd Instance  )  [inline]
 

Definition at line 28 of file m_blockcaps.cpp.

00028 : ModeHandler(Instance, 'P', 0, 0, false, MODETYPE_CHANNEL, false) { }


Member Function Documentation

ModeAction BlockCaps::OnModeChange userrec source,
userrec dest,
chanrec channel,
std::string parameter,
bool  adding
[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 30 of file m_blockcaps.cpp.

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

00031         {
00032                 if (adding)
00033                 {
00034                         if (!channel->IsModeSet('P'))
00035                         {
00036                                 channel->SetMode('P',true);
00037                                 return MODEACTION_ALLOW;
00038                         }
00039                 }
00040                 else
00041                 {
00042                         if (channel->IsModeSet('P'))
00043                         {
00044                                 channel->SetMode('P',false);
00045                                 return MODEACTION_ALLOW;
00046                         }
00047                 }
00048 
00049                 return MODEACTION_DENY;
00050         }


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