InspIRCd  3.0
Public Member Functions | Static Public Member Functions | List of all members
ClientProtocol::Messages::Mode Class Reference

#include <clientprotocolmsg.h>

Inheritance diagram for ClientProtocol::Messages::Mode:
ClientProtocol::Message ClientProtocol::MessageSource

Public Member Functions

 Mode (User *source, Channel *Chantarget, User *Usertarget, const Modes::ChangeList &changelist, Modes::ChangeList::List::const_iterator beginiter)
 
 Mode (User *source, Channel *Chantarget, User *Usertarget, const Modes::ChangeList &changelist)
 
 Mode ()
 
void SetParams (Channel *Chantarget, User *Usertarget, const Modes::ChangeList &changelist)
 
Modes::ChangeList::List::const_iterator GetBeginIterator () const
 
Modes::ChangeList::List::const_iterator GetEndIterator () const
 
const std::string & GetStrTarget () const
 
UserGetUserTarget () const
 
ChannelGetChanTarget () const
 
- Public Member Functions inherited from ClientProtocol::Message
 Message (const char *cmd, User *Sourceuser=NULL)
 
 Message (const char *cmd, const std::string &Sourcestr, User *Sourceuser=NULL)
 
const ParamList & GetParams () const
 
const TagMapGetTags () const
 
const char * GetCommand () const
 
void PushParam (const char *str)
 
void PushParam (const std::string &str)
 
void PushParamRef (const std::string &str)
 
void PushParamPlaceholder ()
 
void ReplaceParam (unsigned int index, const char *str)
 
void ReplaceParam (unsigned int index, const std::string &str)
 
void ReplaceParamRef (unsigned int index, const std::string &str)
 
void AddTag (const std::string &tagname, MessageTagProvider *tagprov, const std::string &val, void *tagdata=NULL)
 
void AddTags (const ClientProtocol::TagMap &newtags)
 
const SerializedMessage & GetSerialized (const SerializedInfo &serializeinfo) const
 
void ClearParams ()
 
void InvalidateCache ()
 
void CopyAll ()
 
void SetSideEffect (bool Sideeffect)
 
bool IsSideEffect () const
 
- Public Member Functions inherited from ClientProtocol::MessageSource
 MessageSource (User *Sourceuser=NULL)
 
 MessageSource (const std::string &Sourcestr, User *Sourceuser=NULL)
 
const std::string * GetSource () const
 
UserGetSourceUser () const
 
void SetSourceUser (User *Sourceuser)
 
void SetSource (const std::string &Sourcestr, User *Sourceuser=NULL)
 
void SetSource (const MessageSource &other)
 

Static Public Member Functions

static std::string ToModeLetters (const Modes::ChangeList &changelist)
 

Additional Inherited Members

- Public Types inherited from ClientProtocol::Message
typedef std::vector< ParamParamList
 
- Protected Member Functions inherited from ClientProtocol::Message
void SetCommand (const char *cmd)
 

Detailed Description

MODE message. Sent when modes are changed on a user or channel.

Constructor & Destructor Documentation

◆ Mode() [1/3]

ClientProtocol::Messages::Mode::Mode ( User source,
Channel Chantarget,
User Usertarget,
const Modes::ChangeList changelist,
Modes::ChangeList::List::const_iterator  beginiter 
)
inline

Constructor, populate parameters starting from a given position in a mode change list.

Parameters
sourceUser doing the mode change.
ChantargetChannel target of the mode change. May be NULL if Usertarget is non-NULL.
UsertargetUser target of the mode change. May be NULL if Chantarget is non-NULL.
changelistMode change list. Must remain valid and unchanged as long as this object is alive or until the next SetParams() call.
beginiterStarting position of mode changes in 'changelist'.

◆ Mode() [2/3]

ClientProtocol::Messages::Mode::Mode ( User source,
Channel Chantarget,
User Usertarget,
const Modes::ChangeList changelist 
)
inline

Constructor, populate parameters starting from the beginning of a mode change list.

Parameters
sourceUser doing the mode change.
ChantargetChannel target of the mode change. May be NULL if Usertarget is non-NULL.
UsertargetUser target of the mode change. May be NULL if Chantarget is non-NULL.
changelistMode change list. Must remain valid and unchanged as long as this object is alive or until the next SetParams() call.

◆ Mode() [3/3]

ClientProtocol::Messages::Mode::Mode ( )
inline

Constructor. Does not populate parameters, call SetParams() before sending the message. The message source is set to the local server.

Member Function Documentation

◆ GetBeginIterator()

Modes::ChangeList::List::const_iterator ClientProtocol::Messages::Mode::GetBeginIterator ( ) const
inline

Get first mode change included in this MODE message.

Returns
Iterator to the first mode change that is included in this MODE message.

◆ GetChanTarget()

Channel* ClientProtocol::Messages::Mode::GetChanTarget ( ) const
inline

Get channel target.

Returns
Channel target or NULL if the mode change targets a user.

◆ GetEndIterator()

Modes::ChangeList::List::const_iterator ClientProtocol::Messages::Mode::GetEndIterator ( ) const
inline

Get first mode change not included in this MODE message.

Returns
Iterator to the first mode change that is not included in this MODE message.

◆ GetStrTarget()

const std::string& ClientProtocol::Messages::Mode::GetStrTarget ( ) const
inline

Get mode change target as a string. This is the name of the channel if the mode change targets a channel or the nickname of the user if the target is a user.

Returns
Name of target as a string.

◆ GetUserTarget()

User* ClientProtocol::Messages::Mode::GetUserTarget ( ) const
inline

Get user target.

Returns
User target or NULL if the mode change targets a channel.

◆ SetParams()

void ClientProtocol::Messages::Mode::SetParams ( Channel Chantarget,
User Usertarget,
const Modes::ChangeList changelist 
)
inline

Set parameters

Parameters
ChantargetChannel target of the mode change. May be NULL if Usertarget is non-NULL.
UsertargetUser target of the mode change. May be NULL if Chantarget is non-NULL.
changelistMode change list. Must remain valid and unchanged as long as this object is alive or until the next SetParams() call.

◆ ToModeLetters()

static std::string ClientProtocol::Messages::Mode::ToModeLetters ( const Modes::ChangeList changelist)
inlinestatic

Convert an entire mode change list into mode letters and '+' and '-' characters.

Parameters
changelistMode change list to convert into mode letters.
Returns
Mode letters.

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